mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-04 18:34:27 +02:00
- improvement observe Smarty::$_CHARSET in debugging console https://github.com/smarty-php/smarty/issues/169
This commit is contained in:
@@ -1,4 +1,7 @@
|
||||
===== 3.1.30-dev ===== (xx.xx.xx)
|
||||
26.01.2016
|
||||
- improvement observe Smarty::$_CHARSET in debugging console https://github.com/smarty-php/smarty/issues/169
|
||||
|
||||
02.01.2016
|
||||
- update scope handling
|
||||
- optimize block plugin compiler
|
||||
|
@@ -24,10 +24,7 @@
|
||||
*/
|
||||
function smarty_modifier_debug_print_var($var, $max = 10, $length = 40, $depth = 0, $objects = array())
|
||||
{
|
||||
$_replace = array("\n" => '\n',
|
||||
"\r" => '\r',
|
||||
"\t" => '\t'
|
||||
);
|
||||
$_replace = array("\n" => '\n', "\r" => '\r', "\t" => '\t');
|
||||
switch (gettype($var)) {
|
||||
case 'array' :
|
||||
$results = '<b>Array (' . count($var) . ')</b>';
|
||||
@@ -35,9 +32,8 @@ function smarty_modifier_debug_print_var($var, $max = 10, $length = 40, $depth =
|
||||
break;
|
||||
}
|
||||
foreach ($var as $curr_key => $curr_val) {
|
||||
$results .= '<br>' . str_repeat(' ', $depth * 2)
|
||||
. '<b>' . strtr($curr_key, $_replace) . '</b> => '
|
||||
. smarty_modifier_debug_print_var($curr_val, $max, $length, ++ $depth, $objects);
|
||||
$results .= '<br>' . str_repeat(' ', $depth * 2) . '<b>' . strtr($curr_key, $_replace) .
|
||||
'</b> => ' . smarty_modifier_debug_print_var($curr_val, $max, $length, ++ $depth, $objects);
|
||||
$depth --;
|
||||
}
|
||||
break;
|
||||
@@ -54,9 +50,8 @@ function smarty_modifier_debug_print_var($var, $max = 10, $length = 40, $depth =
|
||||
}
|
||||
$objects[] = $var;
|
||||
foreach ($object_vars as $curr_key => $curr_val) {
|
||||
$results .= '<br>' . str_repeat(' ', $depth * 2)
|
||||
. '<b> ->' . strtr($curr_key, $_replace) . '</b> = '
|
||||
. smarty_modifier_debug_print_var($curr_val, $max, $length, ++ $depth, $objects);
|
||||
$results .= '<br>' . str_repeat(' ', $depth * 2) . '<b> ->' . strtr($curr_key, $_replace) .
|
||||
'</b> = ' . smarty_modifier_debug_print_var($curr_val, $max, $length, ++ $depth, $objects);
|
||||
$depth --;
|
||||
}
|
||||
break;
|
||||
@@ -88,12 +83,12 @@ function smarty_modifier_debug_print_var($var, $max = 10, $length = 40, $depth =
|
||||
$results = mb_substr($var, 0, $length - 3, Smarty::$_CHARSET) . '...';
|
||||
}
|
||||
} else {
|
||||
if (isset($var[$length])) {
|
||||
if (isset($var[ $length ])) {
|
||||
$results = substr($var, 0, $length - 3) . '...';
|
||||
}
|
||||
}
|
||||
|
||||
$results = htmlspecialchars('"' . $results . '"');
|
||||
$results = htmlspecialchars('"' . $results . '"', ENT_QUOTES, Smarty::$_CHARSET);
|
||||
break;
|
||||
|
||||
case 'unknown type' :
|
||||
@@ -109,7 +104,7 @@ function smarty_modifier_debug_print_var($var, $max = 10, $length = 40, $depth =
|
||||
}
|
||||
}
|
||||
|
||||
$results = htmlspecialchars($results);
|
||||
$results = htmlspecialchars($results, ENT_QUOTES, Smarty::$_CHARSET);
|
||||
}
|
||||
|
||||
return $results;
|
||||
|
Reference in New Issue
Block a user