aidan           Tue Jul  6 18:42:47 2004 EDT

  Modified files:              
    /phpdoc/en/reference/info/functions get-magic-quotes-gpc.xml 
  Log:
  Updated example to handle "deep" arrays
  
http://cvs.php.net/diff.php/phpdoc/en/reference/info/functions/get-magic-quotes-gpc.xml?r1=1.9&r2=1.10&ty=u
Index: phpdoc/en/reference/info/functions/get-magic-quotes-gpc.xml
diff -u phpdoc/en/reference/info/functions/get-magic-quotes-gpc.xml:1.9 
phpdoc/en/reference/info/functions/get-magic-quotes-gpc.xml:1.10
--- phpdoc/en/reference/info/functions/get-magic-quotes-gpc.xml:1.9     Tue Jul  6 
03:54:58 2004
+++ phpdoc/en/reference/info/functions/get-magic-quotes-gpc.xml Tue Jul  6 18:42:47 
2004
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.9 $ -->
+<!-- $Revision: 1.10 $ -->
 <!-- splitted from ./en/functions/info.xml, last change in rev 1.2 -->
   <refentry id="function.get-magic-quotes-gpc">
    <refnamediv>
@@ -70,9 +70,18 @@
 <![CDATA[
 <?php
 if (get_magic_quotes_gpc()) {
-    $_POST = array_map('stripslashes', $_POST);
-    $_GET = array_map('stripslashes', $_GET);
-    $_COOKIE = array_map('stripslashes', $_COOKIE);
+    function stripslashes_deep($value)
+    {
+        $value = is_array($value) ?
+                    array_map('stripslashes_deep', $value) :
+                    stripslashes($value);
+
+        return $value;
+    }
+
+    $_POST = array_map('stripslashes_deep', $_POST);
+    $_GET = array_map('stripslashes_deep', $_GET);
+    $_COOKIE = array_map('stripslashes_deep', $_COOKIE);
 }
 ]]>
       </programlisting>

Reply via email to