<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>SoftDux Technical Blog &#187; injection</title>
	<atom:link href="http://blog.softdux.com/tag/injection/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.softdux.com</link>
	<description>Software, Linux &#38; Networking Blog &#38; HOWTOs, Web Development</description>
	<lastBuildDate>Wed, 01 Sep 2010 14:23:29 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Alternative to magic_quotes in PHP 5.3 and PHP6</title>
		<link>http://blog.softdux.com/web-development/php/alternative-to-magic_quotes-in-php-5-3-and-php6</link>
		<comments>http://blog.softdux.com/web-development/php/alternative-to-magic_quotes-in-php-5-3-and-php6#comments</comments>
		<pubDate>Sun, 11 Oct 2009 20:06:07 +0000</pubDate>
		<dc:creator>Rudi</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[injection]]></category>
		<category><![CDATA[magic_quotes]]></category>
		<category><![CDATA[magic_quotes_gpc]]></category>
		<category><![CDATA[protection]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://blog.softdux.com/?p=260</guid>
		<description><![CDATA[PHP 5.3 and PHP6 will discontinue the use of magic_quotes for security reasons, and this means that your website may, or already have, break if you still rely on magic_quotes_gpc. Below is some code that will give you the same functionality as magic_quotes_gpc: < ?php function clear_magic_quotes() { if (get_magic_quotes_gpc()) { /* All these global [...]]]></description>
			<content:encoded><![CDATA[<p>PHP 5.3 and PHP6 will discontinue the use of <a href="http://www.php.net/manual/en/security.magicquotes.php">magic_quotes</a> for security reasons, and this means that your website may, or already have, break if you still rely on magic_quotes_gpc. </p>
<p>Below is some code that will give you the same functionality as magic_quotes_gpc:</p>
<blockquote><p>
< ?php</p>
<p>function clear_magic_quotes()<br />
{<br />
    if (get_magic_quotes_gpc()) {<br />
        /*<br />
        All these global variables are slash-encoded by default,<br />
        because    magic_quotes_gpc is set by default!<br />
        (And magic_quotes_gpc affects more than just $_GET, $_POST, and $_COOKIE)<br />
        */<br />
        $_SERVER = stripslashes_array($_SERVER);<br />
        $_GET = stripslashes_array($_GET);<br />
        $_POST = stripslashes_array($_POST);<br />
        $_COOKIE = stripslashes_array($_COOKIE);<br />
        $_FILES = stripslashes_array($_FILES);<br />
        $_ENV = stripslashes_array($_ENV);<br />
        $_REQUEST = stripslashes_array($_REQUEST);<br />
        $HTTP_SERVER_VARS = stripslashes_array($HTTP_SERVER_VARS);<br />
        $HTTP_GET_VARS = stripslashes_array($HTTP_GET_VARS);<br />
        $HTTP_POST_VARS = stripslashes_array($HTTP_POST_VARS);<br />
        $HTTP_COOKIE_VARS = stripslashes_array($HTTP_COOKIE_VARS);<br />
        $HTTP_POST_FILES = stripslashes_array($HTTP_POST_FILES);<br />
        $HTTP_ENV_VARS = stripslashes_array($HTTP_ENV_VARS);<br />
        if (isset($_SESSION))  #These are unconfirmed (?)<br />
        {<br />
            $_SESSION = stripslashes_array($_SESSION, '');<br />
            $HTTP_SESSION_VARS = stripslashes_array($HTTP_SESSION_VARS, '');<br />
        }<br />
        /*<br />
        The $GLOBALS array is also slash-encoded, but when all the above are<br />
        changed, $GLOBALS is updated to reflect those changes.  (Therefore<br />
        $GLOBALS should never be modified directly).  $GLOBALS also contains<br />
        infinite recursion, so it's dangerous...<br />
        */<br />
    }<br />
}</p>
<p>function stripslashes_array($data)<br />
{<br />
    if (is_array($data))<br />
    {<br />
        foreach ($data as $key => $value)<br />
        {<br />
            $data[$key] = stripslashes_array($value);<br />
        }<br />
        return $data;<br />
    }<br />
    else<br />
    {<br />
        return stripslashes($data);<br />
    }<br />
}</p>
<p>clear_magic_quotes();   // disable magic quotes<br />
?></p></blockquote>

<div class="sociable">
<div class="sociable_tagline">
<strong>Share and Enjoy:</strong>
</div>
<ul>
	<li class="sociablefirst"><a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fblog.softdux.com%2Fweb-development%2Fphp%2Falternative-to-magic_quotes-in-php-5-3-and-php6&amp;title=Alternative%20to%20magic_quotes%20in%20PHP%205.3%20and%20PHP6&amp;bodytext=PHP%205.3%20and%20PHP6%20will%20discontinue%20the%20use%20of%20magic_quotes%20for%20security%20reasons%2C%20and%20this%20means%20that%20your%20website%20may%2C%20or%20already%20have%2C%20break%20if%20you%20still%20rely%20on%20magic_quotes_gpc.%20%0D%0A%0D%0ABelow%20is%20some%20code%20that%20will%20give%20you%20the%20same%20functionality%20as%20ma" title="Digg"><img src="http://blog.softdux.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://sphinn.com/index.php?c=post&amp;m=submit&amp;link=http%3A%2F%2Fblog.softdux.com%2Fweb-development%2Fphp%2Falternative-to-magic_quotes-in-php-5-3-and-php6" title="Sphinn"><img src="http://blog.softdux.com/wp-content/plugins/sociable/images/sphinn.png" title="Sphinn" alt="Sphinn" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fblog.softdux.com%2Fweb-development%2Fphp%2Falternative-to-magic_quotes-in-php-5-3-and-php6&amp;title=Alternative%20to%20magic_quotes%20in%20PHP%205.3%20and%20PHP6&amp;notes=PHP%205.3%20and%20PHP6%20will%20discontinue%20the%20use%20of%20magic_quotes%20for%20security%20reasons%2C%20and%20this%20means%20that%20your%20website%20may%2C%20or%20already%20have%2C%20break%20if%20you%20still%20rely%20on%20magic_quotes_gpc.%20%0D%0A%0D%0ABelow%20is%20some%20code%20that%20will%20give%20you%20the%20same%20functionality%20as%20ma" title="del.icio.us"><img src="http://blog.softdux.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fblog.softdux.com%2Fweb-development%2Fphp%2Falternative-to-magic_quotes-in-php-5-3-and-php6&amp;t=Alternative%20to%20magic_quotes%20in%20PHP%205.3%20and%20PHP6" title="Facebook"><img src="http://blog.softdux.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.mixx.com/submit?page_url=http%3A%2F%2Fblog.softdux.com%2Fweb-development%2Fphp%2Falternative-to-magic_quotes-in-php-5-3-and-php6&amp;title=Alternative%20to%20magic_quotes%20in%20PHP%205.3%20and%20PHP6" title="Mixx"><img src="http://blog.softdux.com/wp-content/plugins/sociable/images/mixx.png" title="Mixx" alt="Mixx" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fblog.softdux.com%2Fweb-development%2Fphp%2Falternative-to-magic_quotes-in-php-5-3-and-php6&amp;title=Alternative%20to%20magic_quotes%20in%20PHP%205.3%20and%20PHP6&amp;annotation=PHP%205.3%20and%20PHP6%20will%20discontinue%20the%20use%20of%20magic_quotes%20for%20security%20reasons%2C%20and%20this%20means%20that%20your%20website%20may%2C%20or%20already%20have%2C%20break%20if%20you%20still%20rely%20on%20magic_quotes_gpc.%20%0D%0A%0D%0ABelow%20is%20some%20code%20that%20will%20give%20you%20the%20same%20functionality%20as%20ma" title="Google Bookmarks"><img src="http://blog.softdux.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="" title="De.lirio.us"><img src="http://blog.softdux.com/wp-content/plugins/sociable/images/" title="De.lirio.us" alt="De.lirio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="mailto:?subject=Alternative%20to%20magic_quotes%20in%20PHP%205.3%20and%20PHP6&amp;body=http%3A%2F%2Fblog.softdux.com%2Fweb-development%2Fphp%2Falternative-to-magic_quotes-in-php-5-3-and-php6" title="email"><img src="http://blog.softdux.com/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="" title="Furl"><img src="http://blog.softdux.com/wp-content/plugins/sociable/images/" title="Furl" alt="Furl" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://laaik.it/NewStoryCompact.aspx?uri=http%3A%2F%2Fblog.softdux.com%2Fweb-development%2Fphp%2Falternative-to-magic_quotes-in-php-5-3-and-php6&amp;headline=Alternative%20to%20magic_quotes%20in%20PHP%205.3%20and%20PHP6&amp;cat=5e082fcc-8a3b-47e2-acec-fdf64ff19d12" title="laaik.it"><img src="http://blog.softdux.com/wp-content/plugins/sociable/images/laaikit.png" title="laaik.it" alt="laaik.it" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fblog.softdux.com%2Fweb-development%2Fphp%2Falternative-to-magic_quotes-in-php-5-3-and-php6&amp;title=Alternative%20to%20magic_quotes%20in%20PHP%205.3%20and%20PHP6&amp;source=SoftDux+Technical+Blog+Software%2C+Linux+%26amp%3B+Networking+Blog+%26amp%3B+HOWTOs%2C+Web+Development&amp;summary=PHP%205.3%20and%20PHP6%20will%20discontinue%20the%20use%20of%20magic_quotes%20for%20security%20reasons%2C%20and%20this%20means%20that%20your%20website%20may%2C%20or%20already%20have%2C%20break%20if%20you%20still%20rely%20on%20magic_quotes_gpc.%20%0D%0A%0D%0ABelow%20is%20some%20code%20that%20will%20give%20you%20the%20same%20functionality%20as%20ma" title="LinkedIn"><img src="http://blog.softdux.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.myspace.com/Modules/PostTo/Pages/?u=http%3A%2F%2Fblog.softdux.com%2Fweb-development%2Fphp%2Falternative-to-magic_quotes-in-php-5-3-and-php6&amp;t=Alternative%20to%20magic_quotes%20in%20PHP%205.3%20and%20PHP6" title="MySpace"><img src="http://blog.softdux.com/wp-content/plugins/sociable/images/myspace.png" title="MySpace" alt="MySpace" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://slashdot.org/bookmark.pl?title=Alternative%20to%20magic_quotes%20in%20PHP%205.3%20and%20PHP6&amp;url=http%3A%2F%2Fblog.softdux.com%2Fweb-development%2Fphp%2Falternative-to-magic_quotes-in-php-5-3-and-php6" title="Slashdot"><img src="http://blog.softdux.com/wp-content/plugins/sociable/images/slashdot.png" title="Slashdot" alt="Slashdot" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fblog.softdux.com%2Fweb-development%2Fphp%2Falternative-to-magic_quotes-in-php-5-3-and-php6&amp;title=Alternative%20to%20magic_quotes%20in%20PHP%205.3%20and%20PHP6" title="StumbleUpon"><img src="http://blog.softdux.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://technorati.com/faves?add=http%3A%2F%2Fblog.softdux.com%2Fweb-development%2Fphp%2Falternative-to-magic_quotes-in-php-5-3-and-php6" title="Technorati"><img src="http://blog.softdux.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="" title="YahooMyWeb"><img src="http://blog.softdux.com/wp-content/plugins/sociable/images/" title="YahooMyWeb" alt="YahooMyWeb" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.printfriendly.com/print?url=http%3A%2F%2Fblog.softdux.com%2Fweb-development%2Fphp%2Falternative-to-magic_quotes-in-php-5-3-and-php6&amp;partner=sociable" title="Print"><img src="http://blog.softdux.com/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a></li>
	<li class="sociablelast"><a rel="nofollow"  target="_blank" href="" title="TwitThis"><img src="http://blog.softdux.com/wp-content/plugins/sociable/images/" title="TwitThis" alt="TwitThis" class="sociable-hovers" /></a></li>
</ul>
</div>
]]></content:encoded>
			<wfw:commentRss>http://blog.softdux.com/web-development/php/alternative-to-magic_quotes-in-php-5-3-and-php6/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
