Skip to content

Commit

Permalink
Remove md5 modifier from debug.tpl (#871)
Browse files Browse the repository at this point in the history
* Remove `md5` modifier from debug.tpl

Replaced with a regular function call. 
See #813

* Move `md5()` in debug.tpl to PHP

---------

Co-authored-by: jonathan <jonathan@devrygreenhouses.com>
  • Loading branch information
j-applese3d and jonathan committed Apr 30, 2023
1 parent e28cb09 commit 19df91b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
4 changes: 1 addition & 3 deletions libs/debug.tpl
Expand Up @@ -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>
9 changes: 6 additions & 3 deletions libs/sysplugins/smarty_internal_debug.php
Expand Up @@ -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 ]);
Expand All @@ -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--;
Expand Down

0 comments on commit 19df91b

Please sign in to comment.