Pārlūkot izejas kodu

Separate E_STRICT reporting from E_ALL in internal debug mode (E_STRICT is included in E_ALL only as of PHP 5.4.0)

pdontthink 13 gadi atpakaļ
vecāks
revīzija
209efe7644
2 mainītis faili ar 8 papildinājumiem un 6 dzēšanām
  1. 4 4
      config/conf.pl
  2. 4 2
      include/init.php

+ 4 - 4
config/conf.pl

@@ -4641,12 +4641,12 @@ sub commandB8 {
         print "1     " . ($sm_debug_mode & 1 ? "y" : " ")
             . "      Simple debugging (PHP E_ERROR)\n";
         print "2     " . ($sm_debug_mode & 512 ? "y" : " ")
-            . "      Moderate debugging (PHP E_ALL)\n";
+            . "      Moderate debugging (PHP E_ALL without E_STRICT)\n";
         print "3     " . ($sm_debug_mode & 524288 ? "y" : " ")
-            . "      Advanced debugging (PHP E_ALL plus log errors\n";
-        print "             intentionally suppressed)\n";
+            . "      Advanced debugging (PHP E_ALL (without E_STRICT) plus\n";
+        print "             log errors intentionally suppressed)\n";
         print "4     " . ($sm_debug_mode & 536870912 ? "y" : " ")
-            . "      Strict debugging (PHP E_STRICT)\n";
+            . "      Strict debugging (PHP E_ALL and E_STRICT)\n";
         print "\n";
     
         print "SquirrelMail debug mode (0,1,2,3,4) or d when done? : $WHT";

+ 4 - 2
include/init.php

@@ -223,15 +223,17 @@ if (file_exists(SM_PATH . 'config/config_local.php')) {
 
 /**
  * Set PHP error reporting level based on the SquirrelMail debug mode
+ * E_STRICT = 2048
+ * E_DEPRECATED = 8192
  */
 $error_level = 0;
 if ($sm_debug_mode & SM_DEBUG_MODE_SIMPLE)
     $error_level |= E_ERROR;
 if ($sm_debug_mode & SM_DEBUG_MODE_MODERATE
  || $sm_debug_mode & SM_DEBUG_MODE_ADVANCED)
-    $error_level |= E_ALL;
+    $error_level = ($error_level | E_ALL) & ~2048 & ~8192;
 if ($sm_debug_mode & SM_DEBUG_MODE_STRICT)
-    $error_level |= E_STRICT;
+    $error_level |= 2048 | 8192;
 error_reporting($error_level);