Problems with set_error_handler

Found a bug? Tell us!!
Post Reply
kschenke
Posts: 1
Joined: Fri Jul 29, 2005 5:33 pm

Problems with set_error_handler

Post 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
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Problems with set_error_handler

Post 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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Post Reply