X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=include%2Fphp_setup.inc;h=03727fce5982c85356ac3dcf53927404382bcd16;hb=f147ecff6f7fe1daeaeff11bbf816e5a002dd784;hp=4fdccbc2dd28c65241ca6144f84f4b6db37793d8;hpb=23c6115c65a63970b01c54675c20afc99e8110a0;p=gosa.git diff --git a/include/php_setup.inc b/include/php_setup.inc index 4fdccbc2d..03727fce5 100644 --- a/include/php_setup.inc +++ b/include/php_setup.inc @@ -18,16 +18,152 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +function gosaRaiseError($errno, $errstr, $errfile, $errline) +{ + global $error_collector,$config; + + /* Return if error reporting is set to zero */ + if (error_reporting() == 0){ + return; + } + + /* Workaround for buggy imap_open error outputs */ + if (preg_match('/imap_open/', $errstr)){ + return; + } + + /* FIXME: Workaround for PHP5 error message flooding. The new OOM + code want's us to use public/protected/private instead of flat + var declarations. For now I can't workaround this - let's ignore + the messages till the next major release which may drop support + for PHP4. */ + if (preg_match('/var: Deprecated./', $errstr)){ + return; + } + + /* FIXME: Same as above. Compatibility does error flooding.*/ + if (preg_match('/zend.ze1_compatibility_mode/', $errstr)){ + return; + } + + /* Hide ldap size limit messages */ + if (preg_match('/ldap_error/', $errstr)){ + if (preg_match('/sizelimit/', $errstr)){ + return; + } + } + + if((isset($config->data))){ + if((isset($config->data['MAIN']['DISPLAYERRORS']))&&(!preg_match("/^true$/i",$config->data['MAIN']['DISPLAYERRORS']))){ + + /* Write to syslog */ + gosa_log ("PHP error: $errstr ($errfile, line $errline)"); + return; + } + } + + + /* Create header as needed */ + if ($error_collector == ""){ + if (isset($_SESSION['js']) && $_SESSION['js']==FALSE){ + $error_collector= "
"._("PHP error")." \"$errstr\" | ||
"._("Trace")."[$index]: $loc | "; + $error_collector.= ""._("File").": $file ("._('Line')." $line) | "._("Type").": $type |
"._("Arguments").": $args |