Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

common.inc errors #37

Open
djfake opened this issue Apr 30, 2019 · 0 comments
Open

common.inc errors #37

djfake opened this issue Apr 30, 2019 · 0 comments

Comments

@djfake
Copy link

djfake commented Apr 30, 2019

Since 6.28, I've been applying this patch to /var/www/includes/common.inc to quiet down errors in my logs for certain PHP warnings. Maybe could be added?

mktime(): You should be using the time() function instead in /var/www/includes/common.inc(1773) : eval()'d code on line 6.

here's the old patch:

diff --git a/includes/common.inc b/includes/common.inc
index 2abf198..d59a611 100644
--- a/includes/common.inc
+++ b/includes/common.inc
@@ -665,7 +665,11 @@ function drupal_error_handler($errno, $message, $filename, $line, $context) {
     return;
   }
 
-  if ($errno & (E_ALL ^ E_DEPRECATED ^ E_NOTICE)) {
+  $error_const = E_ALL ^ E_DEPRECATED ^ E_NOTICE ^ E_STRICT;
+  if (version_compare(phpversion(), '5.4.0') < 0) {
+    $error_const = E_ALL ^ E_DEPRECATED ^ E_NOTICE;
+  }
+  if ($errno & $error_const) {
     $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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant