I need make security system in php application. I have problem with that, because this project is very big and haven't any security. In all queries somebody use $_POST variables without e.g mysql_real_escape_string. Changing each query to PDO or MySQLi will take a lot of time. I know that this is the best way, but Can I protect code generally - in core of application. e.g. :
foreach ($_POST as $name => $data)
{
$_POST[$name] = mysql_real_escape_string($data);
}
foreach ($_GET as $name => $data)
{
$_GET[$name] = mysql_real_escape_string($data);
}
I read that this idea is stupid in this topic