Fatal_Error() is not defined when database error occurs?

Discuss, research, share, find, and solve bugs

Fatal_Error() is not defined when database error occurs?

Postby lightnb » 6:07pm, Sat 17 Aug, 2013

Test case:

1. Upload a clean install of the latest version.
2. Do not do anything with the default configuration file.
3. Attempt to access the /lists/ url.

Result: You get a blank screen, with a 500 response code.
Expected result: A message should appear on the screen that reads, "Cannot connect to database, access denied. Please contact the administrator". (this message is on line 38 of mysql.inc).

The Sql_Connect() function on line 15 of mysql.inc gets a 1045 error code from MySQL, because the user has not set-up any database credentials yet. The "case 1045:" block on line 32 runs, and calls a function called Fatal_Error(). It appears, however, that the Fatal_Error() function is not defined at the time of the error, and the message is not logged or printed anywhere.

To fix, we would need to either define Fatal_Error() before Sql_Connect() is called, or simply change the calls to Fatal_Error() to simple echo statements instead.

Also, I should be seeing a fatal error for calling the undefined function Fatal_Error(), but this is not appearing anywhere. I assume the application is overriding the server-level configuration for error reporting? We should really have a var called $VerboseDeath or similar that default to on, and we can turn it off once everything is working.
lightnb
phpList newbie
 
Posts: 4
Joined: 9:36pm, Sun 22 Nov, 2009

Return to Bug Discussion

Who is online

Users browsing this forum: No registered users and 1 guest

cron