View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0007627 | mantisbt | other | public | 2006-12-07 09:01 | 2006-12-07 09:01 |
Reporter | anselm | Assigned To | |||
Priority | normal | Severity | major | Reproducibility | always |
Status | new | Resolution | open | ||
Product Version | 1.1.0a1 | ||||
Summary | 0007627: bug in gpcget*_array error testing | ||||
Description | in core/gpc_api.php, all the gpcget*_array functions use this piece of code : If we the result isn't the default we were given or an array, errorif ( !( ( ( 1 < func_num_args() ) && ( $t_result === $p_default ) ) || However the 'if' statement does not work as expected ! If you expand the '!' into the brackets , you will see that it is equivalent to : If you do it one more time you get : if ((( !( 1 < func_num_args() ) || !( $t_result === $p_default ) ) && One final time, and you get : As (1 >= func_num_args()) is always true, this is equivalent to : if ($t_result !== $p_default && !is_array($t_result)) Which will only generate an error if the result is not an array and it is not the same as the default. Howver if no default was passed in, and $t_result is null this will not generate an error. | ||||
Tags | No tags attached. | ||||