<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DZone Snippets: gpc code</title>
    <link>http://snippets.dzone.com/posts</link>
    <pubDate>Mon, 08 Sep 2008 08:33:00 GMT</pubDate>
    <description>DZone Snippets: gpc code</description>
    <item>
      <title>Remove magic quotes on GPC data</title>
      <link>http://snippets.dzone.com/posts/show/5257</link>
      <description>Removes magic quotes on $_GET, $_POST, $_COOKIE, $_FILES and $_REQUEST, when they are enabled.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&lt;?php&lt;br /&gt;&lt;br /&gt;// remove magic_quotes&lt;br /&gt;if(get_magic_quotes_gpc())&lt;br /&gt;{&lt;br /&gt;  function undo_magic_quotes_array($array)&lt;br /&gt;  {&lt;br /&gt;    return is_array($array) ? array_map('undo_magic_quotes_array', $array) : str_replace("\\'", "'",&lt;br /&gt;							                                                               str_replace("\\\"", "\"",&lt;br /&gt;                                                                             str_replace("\\\\", "\\",&lt;br /&gt;                                                                             str_replace("\\\x00", "\x00", $array))));&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  $_GET = undo_magic_quotes_array($_GET);&lt;br /&gt;  $_POST = undo_magic_quotes_array($_POST);&lt;br /&gt;  $_COOKIE = undo_magic_quotes_array($_COOKIE);&lt;br /&gt;  $_FILES = undo_magic_quotes_array($_FILES);&lt;br /&gt;  $_REQUEST = undo_magic_quotes_array($_REQUEST);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;?&gt;&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Wed, 19 Mar 2008 15:31:35 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/5257</guid>
      <author>albert006 (Albert Peschar)</author>
    </item>
    <item>
      <title>Remove magic quotes on GPC data</title>
      <link>http://snippets.dzone.com/posts/show/5256</link>
      <description>Removes magic quotes on $_GET, $_POST, $_COOKIE, $_FILES and $_REQUEST, when they are enabled.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&lt;?php&lt;br /&gt;&lt;br /&gt;// remove magic_quotes&lt;br /&gt;if(get_magic_quotes_gpc())&lt;br /&gt;{&lt;br /&gt;  function undo_magic_quotes_array($array)&lt;br /&gt;  {&lt;br /&gt;    return is_array($array) ? array_map('undo_magic_quotes_array', $array) : str_replace("\\'", "'",&lt;br /&gt;							                                                               str_replace("\\\"", "\"",&lt;br /&gt;                                                                             str_replace("\\\\", "\\",&lt;br /&gt;                                                                             str_replace("\\\x00", "\x00", $array))));&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  $_GET = undo_magic_quotes_array($_GET);&lt;br /&gt;  $_POST = undo_magic_quotes_array($_POST);&lt;br /&gt;  $_COOKIE = undo_magic_quotes_array($_COOKIE);&lt;br /&gt;  $_FILES = undo_magic_quotes_array($_FILES);&lt;br /&gt;  $_REQUEST = undo_magic_quotes_array($_REQUEST);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;?&gt;&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Wed, 19 Mar 2008 15:31:30 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/5256</guid>
      <author>albert006 (Albert Peschar)</author>
    </item>
  </channel>
</rss>
