openrat-cms

OpenRat Content Management System
git clone http://git.code.weiherhei.de/openrat-cms.git
Log | Files | Refs | README

commit 744c5f4bdb1dd9060a07ecb60d5f83ba6b2720bd
parent 60dd7571571801e3b3fe6b5d3c709bf4098609fa
Author: Jan Dankert <develop@jandankert.de>
Date:   Mon, 26 Oct 2020 16:55:36 +0100

Always write fatal error to the standard error log.

Diffstat:
Mmodules/cms/base/Startup.class.php | 16+++++++---------
1 file changed, 7 insertions(+), 9 deletions(-)

diff --git a/modules/cms/base/Startup.class.php b/modules/cms/base/Startup.class.php @@ -125,20 +125,18 @@ class Startup { $error = error_get_last(); - if( !is_null($error) ) + if( $error ) { - $errno = $error["type"]; - $errfile = $error["file"]; - $errline = $error["line"]; - $errstr = $error["message"]; + $errno = @$error["type"]; + $errfile = @$error["file"]; + $errline = @$error["line"]; + $errstr = @$error["message"]; $message = 'Error '.$errno .' '. $errstr.' in '. $errfile.':'. $errline; if(class_exists('logger\Logger')) Logger::error( $message); - else - { - error_log($message); - } + + error_log($message); // It is not possibile to throw an exception out of a shutdown function! // PHP will exit the request directly after executing this method, so a