Hi !!
there are sevral places in index.php whith conditions like
if ($_action=='error' && strlen($_GET['_code']))
where perhaps it could be the same to do
if ($_action=='error' && isset($_GET['_code']))
it's not exaclty the same as if $_GET['_code'] is an empty string the first (original) condition will suceed but not the last proposed one. The advantatge of the last one is that it does not produce any warning in any error_reporting level. Looks like there are many places when this change is feasible, specially if strlen(x) is a way to test if x has been defined or not.
other, not so obvious places where that change could be made are, i.e, change:
$_framed = ( $_GET['_framed'] || $_POST['_framed'] );
for
$_framed = ( isset($_GET['_framed']) || isset($_POST['_framed']) );
this will work always unless there is any situation where _framed could be zero, can this happen ?
Yes, you're right with the problem that strlen(x) will cause a PHP notice when the variable is not defined. To solve this problem I would suggest to use !empty(x) in those if-conditions. The only problem with empty() is, that PHP 4 returns TRUE for string '0' but for most cases in RoundCube this doesn't matter.
Thomas
2005/10/2, David Saez Padros david@ols.es:
Hi !!
there are sevral places in index.php whith conditions like
if ($_action=='error' && strlen($_GET['_code']))
where perhaps it could be the same to do
if ($_action=='error' && isset($_GET['_code']))
it's not exaclty the same as if $_GET['_code'] is an empty string the first (original) condition will suceed but not the last proposed one. The advantatge of the last one is that it does not produce any warning in any error_reporting level. Looks like there are many places when this change is feasible, specially if strlen(x) is a way to test if x has been defined or not.
other, not so obvious places where that change could be made are, i.e, change:
$_framed = ( $_GET['_framed'] || $_POST['_framed'] );
for
$_framed = ( isset($_GET['_framed']) || isset($_POST['_framed']) );
this will work always unless there is any situation where _framed could be zero, can this happen ?