Page 1 of 1

Little bug, error_reporting

PostPosted: Tue May 05, 2009 10:53 am
by teuzzo
At the first access the array $_COOKIE does not exists and if you have error_reporting=E_ALL, there is a notice:

Notice: Undefined index: leonardo_user_prefs in /var/www/.../modules/leonardo/CL_user_prefs.php on line 36

To correct this little bug, on line 36 of the file CL_user_prefs.php you have to sobstiute

Code: Select all
$cval=$_COOKIE['leonardo_user_prefs']; // to do: verify existance first!

with this

Code: Select all
if( isset($_COOKIE['leonardo_user_prefs']) ) $cval=$_COOKIE['leonardo_user_prefs'];   // to do: verify existance first!
else $cval=null;

PostPosted: Tue May 05, 2009 12:32 pm
by manolis
thx for the fix !

I'm surprised this is the only "notice", I think there are quite a few other cases in the code that would bring up "notices"

PostPosted: Tue May 05, 2009 6:18 pm
by teuzzo
Yes, this is another notice:

Notice: import_request_variables() [function.import-request-variables]: No prefix specified - possible security hazard in .../mainfile.php on line 49

I put the comment in the file mainfile.php here:

Code: Select all
if (!ini_get("register_globals")) {

My installation now works.
If i will find other notice, i will write here.[/b]