mirror of
https://github.com/smarty-php/smarty.git
synced 2025-11-02 21:31:48 +01:00
remove warning in debug_print_var on php-resources
This commit is contained in:
@@ -28,7 +28,6 @@ function smarty_modifier_debug_print_var($var, $depth = 0, $length = 40)
|
||||
$return = smarty_modifier_debug_print_var($curr_val, $depth+1, $length);
|
||||
$results .= "<br>".str_repeat(' ', $depth*2)."<b>".strtr($curr_key, $_replace)."</b> => $return";
|
||||
}
|
||||
return $results;
|
||||
} else if (is_object($var)) {
|
||||
$object_vars = get_object_vars($var);
|
||||
$results = "<b>".get_class($var)." Object (".count($object_vars).")</b>";
|
||||
@@ -36,11 +35,11 @@ function smarty_modifier_debug_print_var($var, $depth = 0, $length = 40)
|
||||
$return = smarty_modifier_debug_print_var($curr_val, $depth+1, $length);
|
||||
$results .= "<br>".str_repeat(' ', $depth*2)."<b>$curr_key</b> => $return";
|
||||
}
|
||||
return $results;
|
||||
} else if (is_resource($var)) {
|
||||
$results = '<i>'.(string)$var.'</i>';
|
||||
} else if (empty($var) && $var != "0") {
|
||||
$results = '<i>empty</i>';
|
||||
} else {
|
||||
if (empty($var) && $var != "0") {
|
||||
return '<i>empty</i>';
|
||||
}
|
||||
if (strlen($var) > $length ) {
|
||||
$results = substr($var, 0, $length-3).'...';
|
||||
} else {
|
||||
@@ -48,8 +47,8 @@ function smarty_modifier_debug_print_var($var, $depth = 0, $length = 40)
|
||||
}
|
||||
$results = htmlspecialchars($results);
|
||||
$results = strtr($results, $_replace);
|
||||
return $results;
|
||||
}
|
||||
return $results;
|
||||
}
|
||||
|
||||
/* vim: set expandtab: */
|
||||
|
||||
Reference in New Issue
Block a user