|
|
|
|
Menu |
|
|
Home |
| |
|
Discussions |
| |
|
Tools |
| |
|
Affiliates |
| |
|
Content |
| |
|
Info |
| | |
|
|
|
|
|
User Info |
|
Membership:
Latest: MichaelSnaRe
New Today: 0
New Yesterday: 0
Overall: 9144
People Online:
Visitors: 74
Members: 0
Total: 74
|
|
|
|
|
|
Full disclosure |
|
|
|
|
|
|
|
|
|
IT Security and Insecurity Portal |
|
|
Secure patch, foreach by $_REQUEST |
|
Posted: Sat May 22, 2004 3:24 pm |
|
|
Spacebom |
Regular user |
|
|
Joined: May 20, 2004 |
Posts: 6 |
Location: Valladolid - Spain |
|
|
|
|
|
|
I didn't know which was the forum most adapted to write this. Ultimately I have decided for writing it here.
A friend I help myself with the development of this code, because there are protections on $_GET and $_POST and i think that $_REQUEST is almost necessary.
Code: |
foreach ($_REQUEST as $key=>$value) {
if (get_magic_quotes_gpc()==0 AND !is_array($value)) {
$value = addslashes($value);
}
if (!is_array($value)) {
$value = ereg_replace("\x60","",$value);
$value = str_replace('|','|',$value);
${$key} = $value;
$_REQUEST[$key] = $value;
if (isset($_POST[$key])) { $_POST[$key] = $value; }
if (isset($_COOKIE[$key])) { $_COOKIE[$key] = $value; }
if (isset($_FILE[$key])) { $_FILE[$key] = $value; }
if (isset($_GET[$key])) { $_GET[$key] = $value; }
if (isset($HTTP_POST_VARS[$key])) { $HTTP_POST_VARS[$key] = $value; }
if (isset($HTTP_COOKIE_VARS[$key])) { $HTTP_COOKIE_VARS[$key] = $value; }
if (isset($HTTP_FILE_VARS[$key])) { $HTTP_FILE_VARS[$key] = $value; }
if (isset($HTTP_GET_VARS[$key])) { $HTTP_GET_VARS[$key] = $value; }
}
}
|
Thank u very much and good bye! |
|
|
|
|
|
www.waraxe.us Forum Index -> PhpNuke
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
All times are GMT
Page 1 of 1
|
|
|
Powered by phpBB © 2001-2008 phpBB Group
|
|
|
|
|
|
|