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 ?

Recommended Answers

have you tried running it?

i think magic quotes is now removed from PHP ( think i read it somewhere):

just checked : http://php.net/manual/en/security.magicquotes.php removed since 5.4.

Jump to Post

All 2 Replies

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 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.