function XSSPrintSafe($item)
{
    /* Determine whether a variable is set */
    if (!isset($item)) {
        return $item;
    }
    /* Recursively convert array elements -- nikns */
    if (is_array($item)) {
        for ($i = 0; $i < count($item); $i++) {
            $item[$i] = XSSPrintSafe($item[$i]);
        }
        return $item;
    }
    return Util::htmlentities($item);
}
Example #2
0
function PrintHTTPPost()
{
    echo "<BR><B>HTTP POST Variables</B><PRE>";
    XSSPrintSafe($_POST);
    echo "</PRE>";
}
Example #3
0
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
echo '<TABLE WIDTH="100%" CELLSPACING=0 CELLPADDING=2 BORDER=0>
         <TR><TD> 
           <TABLE WIDTH="100%" CELLSPACING=0 CELLPADDING=2 BORDER=0 BGCOLOR="#FFFFFF">
              <TR><TD class="header">' . gettext("PHP Build:") . '</TD></TR>
              <TR><TD>
         <B>' . gettext("CLIENT:") . '</B> ' . XSSPrintSafe($_SERVER['HTTP_USER_AGENT']) . '<BR>
         <B>' . gettext("SERVER:") . '</B> ' . XSSPrintSafe($_SERVER['SERVER_SOFTWARE']) . '<BR> 
         <B>' . gettext("SERVER HW:") . '</B> ' . php_uname() . '<BR>
         <B>' . gettext("PHP VERSION:") . '</B> ' . phpversion() . '<BR>
         <B>PHP API:</B> ' . php_sapi_name() . '<BR>';
$tmp_error_reporting_str = "";
if ((ini_get("error_reporting") & E_ERROR) > 0) {
    $tmp_error_reporting_str .= " [E_ERROR] ";
}
if ((ini_get("error_reporting") & E_WARNING) > 0) {
    $tmp_error_reporting_str .= " [E_WARNING] ";
}
if ((ini_get("error_reporting") & E_PARSE) > 0) {
    $tmp_error_reporting_str .= " [E_PARSE] ";
}
if ((ini_get("error_reporting") & E_NOTICE) > 0) {
    $tmp_error_reporting_str .= " [E_NOTICE] ";