From 7dfad44658dbd7d6a4f391bc5c060efb0d94bded Mon Sep 17 00:00:00 2001 From: messju Date: Thu, 27 Nov 2003 17:39:06 +0000 Subject: [PATCH] remove warning in debug_print_var on php-resources --- NEWS | 1 + libs/plugins/modifier.debug_print_var.php | 11 +++++------ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/NEWS b/NEWS index ae5c9c9d..74b2a8ca 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,4 @@ + - remove warning in debug_print_var on php-resources (messju) - move function.assign.php to compiler.assign.php (messju) - add property $tpl_error_reporting (messju) - remove property $undefined. "null" is used literally instead (messju) diff --git a/libs/plugins/modifier.debug_print_var.php b/libs/plugins/modifier.debug_print_var.php index 35283113..754d4c2f 100644 --- a/libs/plugins/modifier.debug_print_var.php +++ b/libs/plugins/modifier.debug_print_var.php @@ -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 .= "
".str_repeat(' ', $depth*2)."".strtr($curr_key, $_replace)." => $return"; } - return $results; } else if (is_object($var)) { $object_vars = get_object_vars($var); $results = "".get_class($var)." Object (".count($object_vars).")"; @@ -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 .= "
".str_repeat(' ', $depth*2)."$curr_key => $return"; } - return $results; + } else if (is_resource($var)) { + $results = ''.(string)$var.''; + } else if (empty($var) && $var != "0") { + $results = 'empty'; } else { - if (empty($var) && $var != "0") { - return 'empty'; - } 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: */