diff --git a/Smarty.class.php b/Smarty.class.php index ccc2bb8d..f37e8867 100644 --- a/Smarty.class.php +++ b/Smarty.class.php @@ -518,7 +518,7 @@ class Smarty \*======================================================================*/ function fetch($_smarty_tpl_file, $_smarty_cache_id = null, $_smarty_compile_id = null, $_smarty_display = false) { - $_smarty_old_error_level = error_reporting(error_reporting() & ~E_NOTICE); + $_smarty_old_error_level = $this->debugging ? error_reporting() : error_reporting(error_reporting() & ~E_NOTICE); if (!$this->debugging && $this->debugging_ctrl == 'URL' && strstr($GLOBALS['QUERY_STRING'], $this->_smarty_debug_id)) { @@ -566,10 +566,10 @@ class Smarty } } echo $_smarty_results; - error_reporting($_smarty_old_error_reporting); + error_reporting($_smarty_old_error_level); return true; } else { - error_reporting($_smarty_old_error_reporting); + error_reporting($_smarty_old_error_level); return $_smarty_results; } } else { @@ -616,10 +616,10 @@ class Smarty echo $this->_generate_debug_output(); } - error_reporting($_smarty_old_error_reporting); + error_reporting($_smarty_old_error_level); return; } else { - error_reporting($_smarty_old_error_reporting); + error_reporting($_smarty_old_error_level); if (isset($_smarty_results)) { return $_smarty_results; } } } diff --git a/libs/Smarty.class.php b/libs/Smarty.class.php index ccc2bb8d..f37e8867 100644 --- a/libs/Smarty.class.php +++ b/libs/Smarty.class.php @@ -518,7 +518,7 @@ class Smarty \*======================================================================*/ function fetch($_smarty_tpl_file, $_smarty_cache_id = null, $_smarty_compile_id = null, $_smarty_display = false) { - $_smarty_old_error_level = error_reporting(error_reporting() & ~E_NOTICE); + $_smarty_old_error_level = $this->debugging ? error_reporting() : error_reporting(error_reporting() & ~E_NOTICE); if (!$this->debugging && $this->debugging_ctrl == 'URL' && strstr($GLOBALS['QUERY_STRING'], $this->_smarty_debug_id)) { @@ -566,10 +566,10 @@ class Smarty } } echo $_smarty_results; - error_reporting($_smarty_old_error_reporting); + error_reporting($_smarty_old_error_level); return true; } else { - error_reporting($_smarty_old_error_reporting); + error_reporting($_smarty_old_error_level); return $_smarty_results; } } else { @@ -616,10 +616,10 @@ class Smarty echo $this->_generate_debug_output(); } - error_reporting($_smarty_old_error_reporting); + error_reporting($_smarty_old_error_level); return; } else { - error_reporting($_smarty_old_error_reporting); + error_reporting($_smarty_old_error_level); if (isset($_smarty_results)) { return $_smarty_results; } } }