From 19df91b6920b64e34fedeb5ffcbcea112b8a8d99 Mon Sep 17 00:00:00 2001 From: Jon <24463871+j-applese3d@users.noreply.github.com> Date: Sun, 30 Apr 2023 14:25:39 -0700 Subject: [PATCH] Remove `md5` modifier from debug.tpl (#871) * Remove `md5` modifier from debug.tpl Replaced with a regular function call. See https://github.com/smarty-php/smarty/issues/813 * Move `md5()` in debug.tpl to PHP --------- Co-authored-by: jonathan --- libs/debug.tpl | 4 +--- libs/sysplugins/smarty_internal_debug.php | 9 ++++++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/libs/debug.tpl b/libs/debug.tpl index 4f82a5820..cd9325668 100644 --- a/libs/debug.tpl +++ b/libs/debug.tpl @@ -167,9 +167,7 @@ {/capture} diff --git a/libs/sysplugins/smarty_internal_debug.php b/libs/sysplugins/smarty_internal_debug.php index 570819d26..da67904c5 100644 --- a/libs/sysplugins/smarty_internal_debug.php +++ b/libs/sysplugins/smarty_internal_debug.php @@ -238,9 +238,12 @@ public function display_debug($obj, $full = false) $_config_vars = $ptr->config_vars; ksort($_config_vars); $debugging = $smarty->debugging; + $templateName = $obj->source->type . ':' . $obj->source->name; + $displayMode = $debugging === 2 || !$full; + $offset = $this->offset * 50; $_template = new Smarty_Internal_Template($debObj->debug_tpl, $debObj); if ($obj->_isTplObj()) { - $_template->assign('template_name', $obj->source->type . ':' . $obj->source->name); + $_template->assign('template_name', $templateName); } if ($obj->_objType === 1 || $full) { $_template->assign('template_data', $this->template_data[ $this->index ]); @@ -250,8 +253,8 @@ public function display_debug($obj, $full = false) $_template->assign('assigned_vars', $_assigned_vars); $_template->assign('config_vars', $_config_vars); $_template->assign('execution_time', microtime(true) - $smarty->start_time); - $_template->assign('display_mode', $debugging === 2 || !$full); - $_template->assign('offset', $this->offset * 50); + $_template->assign('targetWindow', $displayMode ? md5("$offset$templateName") : '__Smarty__'); + $_template->assign('offset', $offset); echo $_template->fetch(); if (isset($full)) { $this->index--;