15.07.2007, 14:05
|
#69
|
|
Архивный участник
Join Date: May 2007
Posts: 6
|
Quote:
Originally Posted by Ra1n0
some mistake for me..
find in func.php
PHP Code:
function safe($str) {
$banwords = array ("'", ",", ";", "-");
if ( eregi ( "[a-zA-Z0-9]+", $str ) ) {
$str = str_replace ( $banwords, '', strtolower ( $str ) );
} else {
$str = '';
}
return trim($str);
}
replace to
PHP Code:
function safe($str) {
$banwords = array ("'", ",", ";", "-");
if ( eregi ( "[a-zA-Z0-9]+", $str ) ) {
$str = str_replace ( $banwords, '', $str );
} else {
$str = '';
}
return trim($str);
}
|
I think so it will be more effective
PHP Code:
function safe($str)
{
$banwords = array ("'", ",", ";", "--","drop", "select", "update", "create", "delete", "insert");
if (!eregi("^[A-Z0-9._%@*-]+",$str))
$str = NULL;
else
{
$str2 = str_replace($banwords, '', strtolower($str));
if(strtolower($str2) != strtolower($str)) $str = NULL;
}
return $str;
}
|
|
|