In a login script I found onlline, the creator added this function to prevent SQL-injection attacks.
function Fix($str) {
$str = trim($str);
if(get_magic_quotes_gpc()) {
$str = stripslashes($str);
}
return mysql_real_escape_string($str);
}
Since I read that magic_quotes_gpc
is (or has been) removed, it feels like this function is a bit outdated. Wouldn't just simply using mysqli_real_escape_string($user_input)
add sufficient security?