- bugfix debugging console did not display string values containing \n, \r or \t correctly https://github.com/smarty-php/smarty/issues/66

This commit is contained in:
Uwe Tews
2015-07-01 10:54:45 +02:00
parent a756ce3d9e
commit e5bea506af
4 changed files with 8 additions and 7 deletions

View File

@@ -2,6 +2,7 @@
01.07.2015 01.07.2015
- optimize compile check handling - optimize compile check handling
- update {foreach} compiler - update {foreach} compiler
- bugfix debugging console did not display string values containing \n, \r or \t correctly https://github.com/smarty-php/smarty/issues/66
28.06.2015 28.06.2015
- move $smarty->enableSecurity() into Smarty_Security class - move $smarty->enableSecurity() into Smarty_Security class

View File

@@ -111,7 +111,7 @@ class Smarty extends Smarty_Internal_TemplateBase
/** /**
* smarty version * smarty version
*/ */
const SMARTY_VERSION = '3.1.28-dev/20'; const SMARTY_VERSION = '3.1.28-dev/21';
/** /**
* define variable scopes * define variable scopes

View File

@@ -128,7 +128,7 @@
<tr class="{if $vars@iteration % 2 eq 0}odd{else}even{/if}"> <tr class="{if $vars@iteration % 2 eq 0}odd{else}even{/if}">
<td><h3><font color=blue>${$vars@key}</font></h3> <td><h3><font color=blue>${$vars@key}</font></h3>
{if isset($vars['nocache'])}<b>Nocache</b></br>{/if} {if isset($vars['nocache'])}<b>Nocache</b></br>{/if}
{if isset($vars['scope'])}<b>Origin:</b> {$vars['scope']|debug_print_var:10:80 nofilter}{/if} {if isset($vars['scope'])}<b>Origin:</b> {$vars['scope']|debug_print_var nofilter}{/if}
</td> </td>
<td><h3>Value</h3>{$vars['value']|debug_print_var:10:80 nofilter}</td> <td><h3>Value</h3>{$vars['value']|debug_print_var:10:80 nofilter}</td>
<td>{if isset($vars['attributes'])}<h3>Attributes</h3>{$vars['attributes']|debug_print_var nofilter} {/if}</td> <td>{if isset($vars['attributes'])}<h3>Attributes</h3>{$vars['attributes']|debug_print_var nofilter} {/if}</td>
@@ -141,7 +141,7 @@
{foreach $config_vars as $vars} {foreach $config_vars as $vars}
<tr class="{if $vars@iteration % 2 eq 0}odd{else}even{/if}"> <tr class="{if $vars@iteration % 2 eq 0}odd{else}even{/if}">
<td><h3><font color=blue>#{$vars@key}#</font></h3> <td><h3><font color=blue>#{$vars@key}#</font></h3>
{if isset($vars['scope'])}<b>Origin:</b> {$vars['scope']|debug_print_var:10:80 nofilter}{/if} {if isset($vars['scope'])}<b>Origin:</b> {$vars['scope']|debug_print_var nofilter}{/if}
</td> </td>
<td>{$vars['value']|debug_print_var:10:80 nofilter}</td> <td>{$vars['value']|debug_print_var:10:80 nofilter}</td>
</tr> </tr>
@@ -154,7 +154,7 @@
<script type="text/javascript"> <script type="text/javascript">
{$id = ''} {$id = ''}
{if $display_mode}{$id = "$offset$template_name"|md5}{/if} {if $display_mode}{$id = "$offset$template_name"|md5}{/if}
_smarty_console = window.open("", "console{$id}", "width=680,height=600,left={$offset},top={$offset},resizable,scrollbars=yes"); _smarty_console = window.open("", "console{$id}", "width=1024,height=600,left={$offset},top={$offset},resizable,scrollbars=yes");
_smarty_console.document.write("{$debug_output|escape:'javascript' nofilter}"); _smarty_console.document.write("{$debug_output|escape:'javascript' nofilter}");
_smarty_console.document.close(); _smarty_console.document.close();
</script> </script>

View File

@@ -24,9 +24,9 @@
*/ */
function smarty_modifier_debug_print_var($var, $max = 10, $length = 40, $depth = 0, $objects = array()) function smarty_modifier_debug_print_var($var, $max = 10, $length = 40, $depth = 0, $objects = array())
{ {
$_replace = array("\n" => '<i>\n</i>', $_replace = array("\n" => '\n',
"\r" => '<i>\r</i>', "\r" => '\r',
"\t" => '<i>\t</i>' "\t" => '\t'
); );
switch (gettype($var)) { switch (gettype($var)) {
case 'array' : case 'array' :