From e3c1c7392b7728528291439d815f0368b5b6b5af Mon Sep 17 00:00:00 2001
From: Robert Allerstorfer <roball@405360.no-reply.drupal.org>
Date: Mon, 18 May 2015 19:43:15 +0200
Subject: [PATCH] Only include E_DEPRECATED in error bitmask if it is defined

---
 includes/common.inc | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/includes/common.inc b/includes/common.inc
index 19798ba..8b8fd7b 100644
--- a/includes/common.inc
+++ b/includes/common.inc
@@ -672,7 +672,11 @@ function drupal_error_handler($errno, $message, $filename, $line, $context) {
     return;
   }
 
-  if ($errno & (E_ALL ^ E_DEPRECATED)) {
+  $error_bitmask = E_ALL;
+  // Exclude E_DEPRECATED warnings. This constant has been introduced in
+  // PHP 5.3, thus it is undefined in earlier versions.
+  defined('E_DEPRECATED') && $error_bitmask = $error_bitmask & ~E_DEPRECATED;
+  if ($errno & $error_bitmask) {
     $types = array(1 => 'error', 2 => 'warning', 4 => 'parse error', 8 => 'notice', 16 => 'core error', 32 => 'core warning', 64 => 'compile error', 128 => 'compile warning', 256 => 'user error', 512 => 'user warning', 1024 => 'user notice', 2048 => 'strict warning', 4096 => 'recoverable fatal error');
 
     // For database errors, we want the line number/file name of the place that
-- 
1.9.5

