If you perform if(Request::getParameter(x)) and it is
either and '' or 0 it will return as false and the if
Logged In: YES
This is an interesting bug because it is related to the way
PHP handles true and false. In PHP null, false, '', and 0
are all equivalent.
The easiest way around this is to never rely on implicit
true or false evaluation. For example, always write code
like if (request::getParameter(x) !== null) - in PHP === and
!=== are extra explicit tests that compare for the literal
evaluation. if (null === 0) will return false, for example.
It is generally good practice to be as explicit as possible
because it makes your code easier to read, however I agree
this is rather confusing, and maybe we should look into
using explicit === or !=== in the Request object.
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.