Explorar o código

more php 4.1.2 testing. it is possible that ini_get call is not needed.

tokul %!s(int64=20) %!d(string=hai) anos
pai
achega
45e76e59b8
Modificáronse 1 ficheiros con 11 adicións e 1 borrados
  1. 11 1
      class/error.class.php

+ 11 - 1
class/error.class.php

@@ -68,13 +68,23 @@ class ErrorHandler {
         $iType = NULL;
         $iType = NULL;
         $aErrorCategory = array();
         $aErrorCategory = array();
 
 
+        /**
+         * Get current error reporting level.
+         *
+         * PHP 4.1.2 does not return current error reporting level in ini_get (php 5.1b3 and 
+         * 4.3.10 does). Retrieve current error reporting level while setting error reporting 
+         * to ini value and reset it to retrieved value.
+         */
+        $iCurErrLevel = error_reporting(ini_get('error_reporting'));
+        error_reporting($iCurErrLevel);
+
         /**
         /**
          * Check error_reporting value before logging error.
          * Check error_reporting value before logging error.
          * Don't log errors that are disabled by @ (error_reporting = 0). Some SquirrelMail scripts
          * Don't log errors that are disabled by @ (error_reporting = 0). Some SquirrelMail scripts
          * (sq_mb_list_encodings(), ldap function calls in functions/abook_ldap_server.php)
          * (sq_mb_list_encodings(), ldap function calls in functions/abook_ldap_server.php)
          * handle errors themselves and @ is used to disable generic php error messages.
          * handle errors themselves and @ is used to disable generic php error messages.
          */
          */
-        if ((bool) ini_get('error_reporting')) {
+        if ((bool) $iCurErrLevel) {
             /*
             /*
              * The following errors cannot be handled by a user defined error handler:
              * The following errors cannot be handled by a user defined error handler:
              * E_ERROR, E_PARSE, E_CORE_ERROR, E_CORE_WARNING, E_COMPILE_ERROR, E_COMPILE_WARNING
              * E_ERROR, E_PARSE, E_CORE_ERROR, E_CORE_WARNING, E_COMPILE_ERROR, E_COMPILE_WARNING