HEX
Server: Apache/2.4.25 (Debian)
System: Linux server17 4.9.0-19-amd64 #1 SMP Debian 4.9.320-2 (2022-06-30) x86_64
User: web37 (1062)
PHP: 7.4.30
Disabled: show_source, highlight_file, apache_child_terminate, apache_get_modules, apache_note, apache_setenv, virtual, dl, disk_total_space, posix_getpwnam, posix_getpwuid, posix_mkfifo, posix_mknod, posix_setpgid, posix_setsid, posix_setuid, posix_uname, proc_nice, openlog, syslog, pfsockopen
Upload Files
File: /var/www/web37/htdocs/fickanzeiger/components/template_lite/plugins/modifier.debug_print_var.php
<?php

/*
 * Smarty plugin
 * -------------------------------------------------------------
 * Type:     modifier
 * Name:     debug_print_var
 * Purpose:  formats variable contents for display in the console
 * -------------------------------------------------------------
 */
function tpl_modifier_debug_print_var($var, $depth = 0, $length = 40)
{
    if (is_array($var))
	{
        $results = "<b>Array (".count($var).")</b>";
        foreach ($var as $curr_key => $curr_val)
		{
            $return = tpl_modifier_debug_print_var($curr_val, $depth+1, $length);
            $results .= '<br>\r'.str_repeat('&nbsp;', $depth*2)."<b>$curr_key</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>";
        foreach ($object_vars as $curr_key => $curr_val)
		{
            $return = tpl_modifier_debug_print_var($curr_val, $depth+1, $length);
            $results .= '<br>\r'.str_repeat('&nbsp;', $depth*2)."<b>$curr_key</b> =&gt; $return";
        }
        return $results;
    }
	else
	{
        if (empty($var) && $var != "0")
		{
            return '<i>empty</i>';
        }
        if (strlen($var) > $length )
		{
            $results = substr($var, 0, $length-3).'...';
        }
		else
		{
            $results = $var;
        }
        $results = preg_replace("![\r\t\n]!", " ", $results);
        $results = htmlspecialchars($results);
        return $results;
    }
}

?>