diff --git a/NEWS b/NEWS index c280ec1f..615e507c 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,4 @@ + - fixed bug with cached insert debug timing (Monte) - added 'script' attribute to {insert..} which specifies the script that the insert function can be found in. (Andrei) - added default template function handler. (Monte) diff --git a/Smarty.class.php b/Smarty.class.php index 8202abf3..047f55fd 100644 --- a/Smarty.class.php +++ b/Smarty.class.php @@ -935,7 +935,7 @@ function _is_trusted($resource_type, $resource_name) $_return = false; } $funcname = $this->default_template_handler_func; - $_return = $funcname($tpl_path, $template_source, $template_timestamp, $this); + $_return = $funcname($resource_type, $resource_name, $template_source, $template_timestamp, $this); } } @@ -1100,15 +1100,15 @@ function _is_trusted($resource_type, $resource_name) \*======================================================================*/ function _process_cached_inserts($results) { - if ($this->debugging) { - $debug_start_time = $this->_get_microtime(); - } preg_match_all('!'.$this->_smarty_md5.'{insert_cache (.*)}'.$this->_smarty_md5.'!Uis', $results, $match); list($cached_inserts, $insert_args) = $match; for ($i = 0; $i < count($cached_inserts); $i++) { + if ($this->debugging) { + $debug_start_time = $this->_get_microtime(); + } $args = unserialize($insert_args[$i]); diff --git a/docs.sgml b/docs.sgml index 19f866fe..6b11e3cc 100644 --- a/docs.sgml +++ b/docs.sgml @@ -1602,7 +1602,7 @@ $smarty->display("index.tpl"); argument is the action, which will be one of 'read', 'write' and 'clear'. The second parameter is the smarty object. The third parameter is the cached content. Upon a write, Smarty passed th - cached content in this paramters. Upon a 'read', Smarty expects + cached content in this parameters. Upon a 'read', Smarty expects your function to pass this by reference and populate it with the cached data. Upon a 'clear', pass a dummy variable here since it is not used. The fourth parameter is the name of the template file @@ -4456,7 +4456,7 @@ OUTPUT: 6 -{* you can supply a format paramter in sprintf format *} +{* you can supply a format parameter in sprintf format *} {math equation="x + y" x=4.4444 y=5.0000 format="%.2f"} diff --git a/libs/Smarty.class.php b/libs/Smarty.class.php index 8202abf3..047f55fd 100644 --- a/libs/Smarty.class.php +++ b/libs/Smarty.class.php @@ -935,7 +935,7 @@ function _is_trusted($resource_type, $resource_name) $_return = false; } $funcname = $this->default_template_handler_func; - $_return = $funcname($tpl_path, $template_source, $template_timestamp, $this); + $_return = $funcname($resource_type, $resource_name, $template_source, $template_timestamp, $this); } } @@ -1100,15 +1100,15 @@ function _is_trusted($resource_type, $resource_name) \*======================================================================*/ function _process_cached_inserts($results) { - if ($this->debugging) { - $debug_start_time = $this->_get_microtime(); - } preg_match_all('!'.$this->_smarty_md5.'{insert_cache (.*)}'.$this->_smarty_md5.'!Uis', $results, $match); list($cached_inserts, $insert_args) = $match; for ($i = 0; $i < count($cached_inserts); $i++) { + if ($this->debugging) { + $debug_start_time = $this->_get_microtime(); + } $args = unserialize($insert_args[$i]);