Hello guys, today when I was try to install Joomla on my server it prevents me from continue because of Magic Quotes GPC = ON , so I red about this and saw many sites and PHP iteself recommended to shut this feature,
my question is in my projects I use function I've created to filter the $_POST variables

<?php
function filter($text)
    {
    $text = trim($text);
    $text = strip_tags($text);
    $text = str_ireplace("select","",$text);
    $text = str_ireplace("union", "", $text);
    $text = str_ireplace("update","",$text);
    $text = str_ireplace("insert","",$text);
    $text = str_ireplace("join","",$text);
    $text = str_ireplace("'", "", $text);
    $text = str_ireplace(";", "", $text);
    $text = str_ireplace("$", "", $text);
    $text = str_ireplace("#", "", $text);
    $text = str_ireplace(">", "", $text);
    $text = str_ireplace("<", "", $text);
    $text = str_ireplace("*", "", $text);
    $text = str_ireplace('"', '', $text);
    $text = mysql_real_escape_string($text);
    return $text;
}
?>

usage

$some_var = filter ($_POST['var']);

if I turned off the Magic Quotes GPC does my project still works ?

but am using 5.3 php version and I can't try because the server contain many scripts on it and are not mine so if somthing happened, I'll be killed :P, and my local server on my PC is 5.2 php version so that why am asking before taking the risk.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.