From d024c3df4cddd2e47eba5b30deda0b770712c4f4 Mon Sep 17 00:00:00 2001 From: Ian Date: Mon, 8 Aug 2022 18:06:09 +0200 Subject: [PATCH] Fix end_template/end_render debug condition to check for set start time with PHP 8.1+ --- libs/sysplugins/smarty_internal_debug.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libs/sysplugins/smarty_internal_debug.php b/libs/sysplugins/smarty_internal_debug.php index 5c06e63c..02f8252b 100644 --- a/libs/sysplugins/smarty_internal_debug.php +++ b/libs/sysplugins/smarty_internal_debug.php @@ -69,6 +69,7 @@ class Smarty_Internal_Debug extends Smarty_Internal_Data public function end_template(Smarty_Internal_Template $template) { $key = $this->get_key($template); + if (!isset($this->template_data[ $this->index ][ $key ][ 'start_template_time' ])) return; // see internal_template L 243 $this->template_data[ $this->index ][ $key ][ 'total_time' ] += microtime(true) - $this->template_data[ $this->index ][ $key ][ 'start_template_time' ]; //$this->template_data[$this->index][$key]['properties'] = $template->properties; @@ -142,6 +143,7 @@ class Smarty_Internal_Debug extends Smarty_Internal_Data public function end_render(Smarty_Internal_Template $template) { $key = $this->get_key($template); + if (!isset($this->template_data[ $this->index ][ $key ][ 'start_time' ])) return; // see template_compiled L 119 $this->template_data[ $this->index ][ $key ][ 'render_time' ] += microtime(true) - $this->template_data[ $this->index ][ $key ][ 'start_time' ]; }