The solution would be to avoid the particular error message, but to display that such a fatal error occured, and to instruct the user about the debug mode for further information (perhaps a link to our forum might be appropriate, too). This could be accomplished by registering a shutdown handler (as fatal errors can't be caught by an error handler), and to check whether there was a fatal error at all. A rough outline for insertion to cms.php (or maybe even better to the index.php's):
Code: Select all
function shutdown()
{
$lastError = error_get_last();
if (in_array($lastError['type'], array(E_ERROR, E_PARSE))) {
echo 'A fatal error occured ...';
}
}
if (function_exists('error_get_last')) {
register_shutdown_function('shutdown');
}
What do you think?