?
avatar rumours86
rumours86
23 May 2017

if (!is_int($status) || is_int($status) && !isset($this->responseMap[$status]))

https://github.com/joomla/joomla-cms/blob/staging/libraries/joomla/application/web.php#L562

maybe
if (!is_int($status) && !isset($this->responseMap[$status]))
or
if (!is_int($status) || (is_int($status) && !isset($this->responseMap[$status])))
or
if (!is_int($status) && !isset($this->responseMap[$status]))

avatar rumours86 rumours86 - open - 23 May 2017
avatar joomla-cms-bot joomla-cms-bot - change - 23 May 2017
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 23 May 2017
avatar franz-wohlkoenig franz-wohlkoenig - change - 23 May 2017
Category Libraries
avatar PhilETaylor
PhilETaylor - comment - 23 May 2017

That is 3 year old code from @wilsonge a322a43

avatar wilsonge
wilsonge - comment - 23 May 2017

The first one fails because your starting to check for non-integer keys in the responseMap array which starts to lead to odd behaviour.

The third one is the same as the first one.

The second one is fine - but honestly this code is likely about to get refactored with #16040 anyhow. So not sure how relevant this is

avatar rumours86
rumours86 - comment - 23 May 2017

if (is_int($status) && !isset($this->responseMap[$status]))
or
if (!isset($this->responseMap[$status]))

because (!is_int($status) || is_int($status)) === true

avatar richard67
richard67 - comment - 23 May 2017

@rumours86 You are wrong because of operator precedence: && comes before ||. Same as in maths with multiplication coming before sum

avatar franz-wohlkoenig franz-wohlkoenig - change - 23 May 2017
Status New Discussion
avatar richard67
richard67 - comment - 25 May 2017

Does anybody agree with me that we can close this issue? It seems @rumours86 does not reply.
As I have shown in my previous 2 posts, this issue here is caused by a misunderstanding of operators precedence in PHP.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/16202.

avatar rumours86
rumours86 - comment - 25 May 2017

@richard67 i think you right
example https://middle.valyaev.su/1.php

avatar richard67
richard67 - comment - 25 May 2017

@rumours86 Could you close this issue in the issue tracker or on github then?

avatar rumours86 rumours86 - change - 25 May 2017
Status Discussion Closed
Closed_Date 0000-00-00 00:00:00 2017-05-25 13:13:17
Closed_By rumours86
avatar rumours86 rumours86 - close - 25 May 2017
avatar rumours86
rumours86 - comment - 25 May 2017

@richard67 Thanks for clarifying

Add a Comment

Login with GitHub to post a comment