cvs: smarty / NEWS /libs/plugins modifier.debug_print_var.php

"Messju Mohr" <[email protected]>
Newsgroups gmane.comp.php.cvs.smarty
Message-ID <cvsmessju1069954747@cvsserver>
messju		Thu Nov 27 12:39:07 2003 EDT

  Modified files:              
    /smarty	NEWS 
    /smarty/libs/plugins	modifier.debug_print_var.php 
  Log:
  remove warning in debug_print_var on php-resources
  
  
Index: smarty/NEWS
diff -u smarty/NEWS:1.408 smarty/NEWS:1.409
--- smarty/NEWS:1.408	Mon Nov 24 10:37:02 2003
+++ smarty/NEWS	Thu Nov 27 12:39:06 2003
@@ -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)
Index: smarty/libs/plugins/modifier.debug_print_var.php
diff -u smarty/libs/plugins/modifier.debug_print_var.php:1.9 smarty/libs/plugins/modifier.debug_print_var.php:1.10
--- smarty/libs/plugins/modifier.debug_print_var.php:1.9	Wed Aug 13 10:15:30 2003
+++ smarty/libs/plugins/modifier.debug_print_var.php	Thu Nov 27 12:39:06 2003
@@ -28,7 +28,6 @@
             $return = smarty_modifier_debug_print_var($curr_val, $depth+1, $length);
             $results .= "<br>".str_repeat('&nbsp;', $depth*2)."<b>".strtr($curr_key, $_replace)."</b> =&gt; $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 @@
             $return = smarty_modifier_debug_print_var($curr_val, $depth+1, $length);
             $results .= "<br>".str_repeat('&nbsp;', $depth*2)."<b>$curr_key</b> =&gt; $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 @@
         }
         $results = htmlspecialchars($results);
         $results = strtr($results, $_replace);
-        return $results;
     }
+    return $results;
 }
 
 /* vim: set expandtab: */

-- 
Smarty CVS Mailing List (http://cvs.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.