Page 1 of 1

Problems with set_error_handler

Posted: Fri Jul 29, 2005 6:00 pm
by kschenke
Hi,

I am in the process to merge s9y with an existing php framework.
I think I found a bug in version 0.8.2 :

The existing framework works with set_error_handler to control the errors in a clear way. For stability reasons not found includes stop the program. With this feature in use there seems to be a problem with file include/lang.inc.php line 7:
The @sign hids that each first call of this function is an error because on the first time the variable $serendipity['lang'] is not set and therefore the file is never found. This is the case for example when the admin mode is started.

Workaround:
1) Copy the default language file to a file named
serendipity_lang_.inc.php into the lang directory.
2) add a line with

Code: Select all

$serendipity['lang'] = 'en';
I hope this is of help...................
kschenke

Re: Problems with set_error_handler

Posted: Fri Jul 29, 2005 6:09 pm
by garvinhicking
In fact this is just a poor "error check" to allow custom languages per user.

The proper way would be to use a "file_exists" check, but that would mean 2 function calls for the inclusion. So in terms of performance its faster to try to include the file, and supress a possible error...

Regards,
Garvin