From ab5d8d4e07bb3c8230d0285ef8902ef1979fce51 Mon Sep 17 00:00:00 2001 From: emkael Date: Thu, 18 Oct 2018 02:39:34 +0200 Subject: Updating Smarty --- .../sysplugins/smarty_internal_errorhandler.php | 113 +++++++++++++++++++++ 1 file changed, 113 insertions(+) create mode 100644 lib/smarty/sysplugins/smarty_internal_errorhandler.php (limited to 'lib/smarty/sysplugins/smarty_internal_errorhandler.php') diff --git a/lib/smarty/sysplugins/smarty_internal_errorhandler.php b/lib/smarty/sysplugins/smarty_internal_errorhandler.php new file mode 100644 index 0000000..0ba0065 --- /dev/null +++ b/lib/smarty/sysplugins/smarty_internal_errorhandler.php @@ -0,0 +1,113 @@ + $smarty_dir, 'length' => strlen($smarty_dir),); + } + } + // walk the muted directories and test against $errfile + foreach (self::$mutedDirectories as $key => &$dir) { + if (!$dir) { + // resolve directory and length for speedy comparisons + $file = realpath($key); + if ($file === false) { + // this directory does not exist, remove and skip it + unset(self::$mutedDirectories[ $key ]); + continue; + } + $dir = array('file' => $file, 'length' => strlen($file),); + } + if (!strncmp($errfile, $dir[ 'file' ], $dir[ 'length' ])) { + $_is_muted_directory = true; + break; + } + } + // pass to next error handler if this error did not occur inside SMARTY_DIR + // or the error was within smarty but masked to be ignored + if (!$_is_muted_directory || ($errno && $errno & error_reporting())) { + if (self::$previousErrorHandler) { + return call_user_func( + self::$previousErrorHandler, + $errno, + $errstr, + $errfile, + $errline, + $errcontext + ); + } else { + return false; + } + } + } +} -- cgit v1.2.3