PHP Accounting for magic quotes
<p>I noticed a block of code similar to the following in the PHP laravel framework:</p>

<pre><code>if (get_magic_quotes_gpc())
{
    $magics = array(&amp;$_GET, &amp;$_POST, &amp;$_COOKIE, &amp;$_REQUEST);

    foreach ($magics as &amp;$magic)
    {
        $magic = array_strip_slashes($magic);
    }
}
</code></pre>

<p>I don't really know how to go about testing this, but if I put this in a start.php file that I include on every page, will it take care of magic quotes so I don't have to worry about them?</p>

<p>Edit:</p>

<p>Here is the array_strip_slashes from laravel:</p>

<pre><code>function array_strip_slashes($array)
{
    $result = array();

    foreach($array as $key =&gt; $value)
    {
        $key = stripslashes($key);

        // If the value is an array, we will just recurse back into the
        // function to keep stripping the slashes out of the array,
        // otherwise we will set the stripped value.
        if (is_array($value))
        {
            $result[$key] = array_strip_slashes($value);
        }
        else
        {
            $result[$key] = stripslashes($value);
        }
    }

    return $result;
}
</code></pre>
