diff options
| author | Jon <24463871+j-applese3d@users.noreply.github.com> | 2023-04-30 14:25:39 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-04-30 23:25:39 +0200 |
| commit | 19df91b6920b64e34fedeb5ffcbcea112b8a8d99 (patch) | |
| tree | f02ff9a4a263851bbf279f2b697091afe45734a1 /libs | |
| parent | e28cb0915b4e3749bf57d4ebae2984e25395cfe5 (diff) | |
| download | smarty-19df91b6920b64e34fedeb5ffcbcea112b8a8d99.tar.gz smarty-19df91b6920b64e34fedeb5ffcbcea112b8a8d99.tar.bz2 smarty-19df91b6920b64e34fedeb5ffcbcea112b8a8d99.zip | |
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 <jonathan@devrygreenhouses.com>
Diffstat (limited to 'libs')
| -rw-r--r-- | libs/debug.tpl | 4 | ||||
| -rw-r--r-- | 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 4f82a582..cd932566 100644 --- a/libs/debug.tpl +++ b/libs/debug.tpl @@ -167,9 +167,7 @@ </html> {/capture} <script type="text/javascript"> - {$id = '__Smarty__'} - {if $display_mode}{$id = "$offset$template_name"|md5}{/if} - _smarty_console = window.open("", "console{$id}", "width=1024,height=600,left={$offset},top={$offset},resizable,scrollbars=yes"); + _smarty_console = window.open("", "console{$targetWindow}", "width=1024,height=600,left={$offset},top={$offset},resizable,scrollbars=yes"); _smarty_console.document.write("{$debug_output|escape:'javascript' nofilter}"); _smarty_console.document.close(); </script> diff --git a/libs/sysplugins/smarty_internal_debug.php b/libs/sysplugins/smarty_internal_debug.php index 570819d2..da67904c 100644 --- a/libs/sysplugins/smarty_internal_debug.php +++ b/libs/sysplugins/smarty_internal_debug.php @@ -238,9 +238,12 @@ class Smarty_Internal_Debug extends Smarty_Internal_Data $_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 @@ class Smarty_Internal_Debug extends Smarty_Internal_Data $_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--; |
