X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=library%2FSmarty%2Flibs%2Fplugins%2Fmodifier.debug_print_var.php;h=66363d253208f0ec4551005322f7309a10895fac;hb=a6aac8f950cd7a5d73ce32ee079156f14b8990ec;hp=fa44100e862b57cd99e2bbf76ebaa54868055ce2;hpb=2bdbdc8d8ef229946e225791801e753a7fd5c695;p=friendica.git
diff --git a/library/Smarty/libs/plugins/modifier.debug_print_var.php b/library/Smarty/libs/plugins/modifier.debug_print_var.php
index fa44100e86..66363d2532 100644
--- a/library/Smarty/libs/plugins/modifier.debug_print_var.php
+++ b/library/Smarty/libs/plugins/modifier.debug_print_var.php
@@ -1,53 +1,54 @@
* Name: debug_print_var
* Purpose: formats variable contents for display in the console
*
- * @author Monte Ohrt
- * @param array|object $var variable to be formatted
- * @param integer $depth maximum recursion depth if $var is an array
- * @param integer $length maximum string length if $var is a string
- * @return string
+ * @author Monte Ohrt
+ *
+ * @param array|object $var variable to be formatted
+ * @param integer $depth maximum recursion depth if $var is an array
+ * @param integer $length maximum string length if $var is a string
+ *
+ * @return string
*/
-function smarty_modifier_debug_print_var ($var, $depth = 0, $length = 40)
+function smarty_modifier_debug_print_var($var, $depth = 0, $length = 40)
{
$_replace = array("\n" => '\n',
- "\r" => '\r',
- "\t" => '\t'
- );
+ "\r" => '\r',
+ "\t" => '\t'
+ );
switch (gettype($var)) {
case 'array' :
$results = 'Array (' . count($var) . ')';
foreach ($var as $curr_key => $curr_val) {
$results .= '
' . str_repeat(' ', $depth * 2)
- . '' . strtr($curr_key, $_replace) . ' => '
- . smarty_modifier_debug_print_var($curr_val, ++$depth, $length);
- $depth--;
- }
+ . '' . strtr($curr_key, $_replace) . ' => '
+ . smarty_modifier_debug_print_var($curr_val, ++$depth, $length);
+ $depth --;
+ }
break;
-
+
case 'object' :
$object_vars = get_object_vars($var);
$results = '' . get_class($var) . ' Object (' . count($object_vars) . ')';
foreach ($object_vars as $curr_key => $curr_val) {
$results .= '
' . str_repeat(' ', $depth * 2)
- . ' ->' . strtr($curr_key, $_replace) . ' = '
- . smarty_modifier_debug_print_var($curr_val, ++$depth, $length);
- $depth--;
- }
+ . ' ->' . strtr($curr_key, $_replace) . ' = '
+ . smarty_modifier_debug_print_var($curr_val, ++$depth, $length);
+ $depth --;
+ }
break;
-
+
case 'boolean' :
case 'NULL' :
case 'resource' :
@@ -59,15 +60,15 @@ function smarty_modifier_debug_print_var ($var, $depth = 0, $length = 40)
$results = 'null';
} else {
$results = htmlspecialchars((string) $var);
- }
+ }
$results = '' . $results . '';
break;
-
+
case 'integer' :
case 'float' :
$results = htmlspecialchars((string) $var);
break;
-
+
case 'string' :
$results = strtr($var, $_replace);
if (Smarty::$_MBSTRING) {
@@ -82,7 +83,7 @@ function smarty_modifier_debug_print_var ($var, $depth = 0, $length = 40)
$results = htmlspecialchars('"' . $results . '"');
break;
-
+
case 'unknown type' :
default :
$results = strtr((string) $var, $_replace);
@@ -95,11 +96,9 @@ function smarty_modifier_debug_print_var ($var, $depth = 0, $length = 40)
$results = substr($results, 0, $length - 3) . '...';
}
}
-
+
$results = htmlspecialchars($results);
- }
+ }
return $results;
-}
-
-?>
\ No newline at end of file
+}