X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=gosa-core%2Finclude%2Fphp_setup.inc;h=954cabbfe1b502badf9057dc1458bdb79dceaf9c;hb=1e99420f077c6595a6098da8b0685a852668852f;hp=2732905613aba9c873865be5fe039bda5cee9543;hpb=6481fa989d197e4c75ec321d79b9d770f17aa303;p=gosa.git diff --git a/gosa-core/include/php_setup.inc b/gosa-core/include/php_setup.inc index 273290561..954cabbfe 100644 --- a/gosa-core/include/php_setup.inc +++ b/gosa-core/include/php_setup.inc @@ -26,34 +26,44 @@ function gosaRaiseError($errno, $errstr, $errfile, $errline) { global $error_collector,$config, $error_collector_mailto; - /* Return if error reporting is set to zero */ + // To avoid recursion - restore original error handler. + restore_error_handler(); + + /* Return if error reporting is set to zero + * Also exclude statements prefixed with @ - Comment out the block below to see suppressed errors. + * e.g. @call_function_but_hide_errors() + */ if (error_reporting() == 0){ + set_error_handler('gosaRaiseError', E_WARNING | E_NOTICE | E_USER_ERROR | E_USER_WARNING | E_USER_NOTICE | E_STRICT) ; return; } /* Workaround for buggy imap_open error outputs */ if (preg_match('/imap_open/', $errstr)){ + set_error_handler('gosaRaiseError', E_WARNING | E_NOTICE | E_USER_ERROR | E_USER_WARNING | E_USER_NOTICE | E_STRICT) ; return; } /* Hide ldap size limit messages */ if (preg_match('/ldap_error/', $errstr)){ if (preg_match('/sizelimit/', $errstr)){ + set_error_handler('gosaRaiseError', E_WARNING | E_NOTICE | E_USER_ERROR | E_USER_WARNING | E_USER_NOTICE | E_STRICT) ; return; } } /* Error messages are hidden in GOsa, so we only send them to the logging class and abort here */ if(isset($config->data) && $config->get_cfg_value("displayerrors") != "true"){ - - /* Write to syslog */ - if(class_exists("log") && !preg_match("/No such object/",$errstr)){ - new log("view","error","",array(),"PHP error: $errstr ($errfile, line $errline)"); - } - return; + /* Write to syslog */ + if(class_exists("log") && !preg_match("/No such object/",$errstr)){ + new log("view","error","",array(),"PHP error: $errstr ($errfile, line $errline)"); + } + + set_error_handler('gosaRaiseError', E_WARNING | E_NOTICE | E_USER_ERROR | E_USER_WARNING | E_USER_NOTICE | E_STRICT) ; + return; } - + /* Send all errors to logging class, except "Ldap : No such object" messages*/ if(class_exists("log") && !preg_match("/No such object/",$errstr)){ new log("debug","all",$errfile,array(),"Type:".$errno.", Message:".$errstr.", File:".$errfile.", Line: ".$errline); @@ -84,28 +94,22 @@ function gosaRaiseError($errno, $errstr, $errfile, $errline) if (session::is_set('js') && session::get('js')==FALSE){ $error_collector= "
"; } else { - $error_collector= " - + $error_collector= " +
- - - + + +
- \"\"  - ". - _("Generating this page caused the PHP interpreter to raise some errors!")." - - - -  "._("Send bugreport")." - - - + ".image('images/toolbar-warning.png').""._("Generating this page caused the PHP interpreter to raise some errors!")." + + ".image('images/mailto.png')." "._("Send bugreport")." + + +
-