grrrr
Collapse
X
-
um why? Youre afraid someone will use it remotely? Lol half you folks dont know a thing about php.
-
its not really i just put it like that on here so no one else sees my real function
Leave a comment:
-
Added after 2 minutes:PHP Code:function sanitize($value, $escape = FALSE)
{
if(is_array($value) OR is_object($value))
{
foreach($value as $k => $v)
{
// Handle recursively
$value[$k] = sanitize($v, (bool) $escape);
}
}
elseif(is_string($value))
{
if(get_magic_quotes_gpc())
{
$value = stripslashes($value);
}
if(strpos($value, "\r") === TRUE)
{
$value = str_replace(array("\r\n", "\n"), "\n", $value);
}
return ($escape) ? mysql_real_escape_string($value) : $value;
}
}
$_GET = sanitize($_GET);
$_POST = sanitize($_POST);
$_COOKIE = sanitize($_COOKIE);
and oh i just noticed your function name is a reserved php function, thats stupid.Last edited by CreativityKills; 17.10.10, 06:36.
Leave a comment:
-
Originally posted by nclemale36 View Postso add (,) to
???Code:$badWords = "(delete)|(update)|(union)|(insert)| (drop)|(http)|(--)|(>)|(<)|(&)|(#)";
PHP Code:function clean($str) {
$str = @trim($str);
if(get_magic_quotes_gpc()) {
$str=htmlspecialchars($str);
$str=stripslashes(trim($str));
$search=array("\\","\0","\n","\r","\x1a","'",'"');
$replace=array("\\\\","\\0","\\n","\\r","\Z","\'",'\"');
$str = str_replace($search,$replace,$str);
}
return mysql_real_escape_string($str);
}
Leave a comment:
-
so add (,) to
???Code:$badWords = "(delete)|(update)|(union)|(insert)| (drop)|(http)|(--)|(>)|(<)|(&)|(#)";
Leave a comment:
-
grrrr
i thought i had this covered but seems not.
Code:else if($action=="uprof") { addonline(getuid_sid($sid),"Updating Settings",""); $savat = mysql_real_escape_string($_POST["savat"]); $semail = mysql_real_escape_string($_POST["semail"]); $ubday = mysql_real_escape_string($_POST["ubday"]); $uloc = mysql_real_escape_string($_POST["uloc"]); $usig = mysql_real_escape_string($_POST["usig"]); $usex = mysql_real_escape_string($_POST["usex"]); $ms = mysql_real_escape_string($_POST["ms"]);just had some muppet update all my location and emails to this site always gets hacked.Code:///////////////////// function mysql_real_escape_string($string) { $badWords = "(delete)|(update)|(union)|(insert)| (drop)|(http)|(--)|(>)|(<)|(&)|(#)"; $string = eregi_replace($badWords, "", $string); $string = mysql_real_escape_string($string); return $string; } /////////////////////////////
last person that did this was huwad or his mates .
why dont the codes i got in place stop this ? ? ?Last edited by nclemale36; 16.10.10, 17:16.Tags: None
Leave a comment: