|
||||||||||||||
| FishCart Demo |
FishCart 3.2 RC2 xss_meta() function
function xss_meta( $param, $strip_crlf = TRUE ){
if( strstr($_SERVER['SCRIPT_NAME'], '/maint/') ){
return($param);
}
$strip_crlf = (boolean)$strip_crlf;
$param = str_replace('', '', $param);
//$param = str_replace('&', '&', $param);
$param = ereg_replace('[][\\\|\<\>\=\(\)\%\{\}\`\~\+\*\^"]', ' ', $param);
if( $strip_crlf == TRUE ){
$param = ereg_replace("[\r\n]", ' ', $param);
}
return($param);
}
—
Pre 3.2 RC2 xss_meta() function
function getserver( $name, $strip_crlf = TRUE ){
$param = '';
$curver = (int)str_replace('.', '', phpversion());
if( $curver >= 410 ){ // superglobals available from ver. 4.1.0
$param = $_SERVER["$name"];
}else{ // superglobals aren't available
global $HTTP_COOKIE_VARS;
$param = $HTTP_COOKIE_VARS["$name"];
}
return(addslashes(xss_meta($param,$strip_crlf)));
}
function getcookie( $name, $strip_crlf = TRUE ){
$param = '';
$curver = (int)str_replace('.', '', phpversion());
if( $curver >= 410 ){ // superglobals available from ver. 4.1.0
$param = $_COOKIE["$name"];
}else{ // superglobals aren't available
global $HTTP_COOKIE_VARS;
$param = $HTTP_COOKIE_VARS["$name"];
}
return(addslashes(xss_meta($param,$strip_crlf)));
}
function getparam( $name, $strip_crlf = TRUE ){
$param = '';
$curver = (int)str_replace('.', '', phpversion());
if( $curver >= 410 ){ // superglobals available from ver. 4.1.0
if( @$_POST["$name"] ){ // POST before GET
$param = $_POST["$name"];
}elseif( @$_GET["$name"] ){
$param = $_GET["$name"];
}
}else{ // superglobals aren't available
global $HTTP_POST_VARS, $HTTP_GET_VARS;
if( @$HTTP_POST_VARS["$name"] ){
$param = $HTTP_POST_VARS["$name"];
}elseif( @$HTTP_GET_VARS["$name"] ){
$param = $HTTP_GET_VARS["$name"];
}
}
if (is_array($param)) {
foreach($param as $element) {$element = addslashes(xss_meta($element,$strip_crlf));}
} else {
$param = addslashes(xss_meta($param,$strip_crlf));
}
return($param);
}
function xss_meta( $param, $strip_crlf = TRUE ){
if( strstr($_SERVER['SCRIPT_NAME'], '/maint/') ){
return($param);
}
$strip_crlf = (boolean)$strip_crlf;
$param = str_replace('', '', $param);
//$param = str_replace('&', '&', $param);
$param = ereg_replace('[][\\\|\<\>\=\(\)\%\{\}\`\~\+\*\^"]', ' ', $param);
if( $strip_crlf == TRUE ){
$param = ereg_replace("[\r\n]", ' ', $param);
}
return($param);
}
— |
|||||||||||||
FishNet ®, Inc. 850 S. Greenville, Suite 102 Richardson, Texas 75081 US (972) 669-0041 |
||||||||||||||