| @@ -51,9 +51,8 @@ | ||
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | public static function exceptionHandler(Throwable $exception) |
| 54 | 54 | { |
| 55 | - | |
| 56 | 55 | self::errorHandler(-1, $exception->getMessage(), $exception->getFile(), $exception->getLine()); |
| 57 | 56 | } |
| 58 | 57 | |
| 59 | 58 | public static function errorHandler($error_type, $error_message, $error_file, $error_line) |
| @@ -62,8 +61,14 @@ | ||
| 62 | 61 | if (!$error_type) { |
| 63 | 62 | return; |
| 64 | 63 | } |
| 65 | 64 | |
| 65 | + // Respect the active error_reporting mask so @-suppressed warnings | |
| 66 | + // and globally filtered notices do not get re-logged by this handler. | |
| 67 | + if (-1 !== $error_type && 0 === (error_reporting() & $error_type)) { | |
| 68 | + return false; | |
| 69 | + } | |
| 70 | + | |
| 66 | 71 | $fatal = false; |
| 67 | 72 | |
| 68 | 73 | switch ($error_type) { |
| 69 | 74 | |
| @@ -142,9 +147,9 @@ | ||
| 142 | 147 | $lockfile = self::backupDir().'.lock'; |
| 143 | 148 | $backup_file = self::findBackupFile($error_file); |
| 144 | 149 | |
| 145 | 150 | // If backup exists |
| 146 | - if (file_exists($backup_file)) { | |
| 151 | + if (!empty($backup_file) && file_exists($backup_file)) { | |
| 147 | 152 | |
| 148 | 153 | if (ob_get_length()) ob_end_clean(); |
| 149 | 154 | |
| 150 | 155 | // If on admin side, show file recovery wizard |
| @@ -878,5 +883,5 @@ | ||
| 878 | 883 | } |
| 879 | 884 | } |
| 880 | 885 | |
| 881 | 886 | WPIDE_Error_Handler::boot(); |
| 882 | -} | |
| 887 | +} | |