I am modifing an open source tool. I can not find all the function in the scripts. So i planned include my own script to all pages by htacces. I want to clean post data for SQL Injections. So i added this code to my own script:
foreach($_POST as $key=>$value)
{
$_POST[$key] = str_replace('bad chars for injections', '', $value);
}
foreach($_GET as $key=>$value)
{
$_GET[$key] = str_replace('bad chars for injections', '', $value);
}
foreach($_REQUEST as $key=>$value)
{
$_REQUEST[$key] = str_replace('bad chars for injections', '', $value);
}
This can change post values. The tool can use only cleaned data. But if the tool use file_get_contents('php://input') function, it can see original post data. So i can not trust the tool if it use some way like this.
Is there a way to change these input before use by the tool? I mean override function actually.