Fix error handler for '@'-prefixed calls.
authorMichael M Slusarz <slusarz@curecanti.org>
Thu, 13 Jan 2011 18:12:15 +0000 (11:12 -0700)
committerMichael M Slusarz <slusarz@curecanti.org>
Thu, 13 Jan 2011 18:29:15 +0000 (11:29 -0700)
Fixes, e.g., detecting bad character conversion of a string.

framework/Core/lib/Horde.php

index 0b60015..cec702b 100644 (file)
@@ -167,6 +167,12 @@ HTML;
     static public function errorHandler($errno, $errstr, $errfile, $errline,
                                         $errcontext)
     {
+        // Calls prefixed with '@'.
+        if (error_reporting() == 0) {
+            // Must return false to populate $php_errormsg (as of PHP 5.2).
+            return false;
+        }
+
         if (class_exists('Horde_Log')) {
             try {
                 self::logMessage(new ErrorException('PHP ERROR: ' . $errstr, 0, $errno, $errfile, $errline), 'DEBUG');