aidan Wed Nov 24 21:47:55 2004 EDT
Modified files: /phpdoc/en/reference/info/functions get-magic-quotes-gpc.xml Log: Removed duplicated info, and pointed users to the security section http://cvs.php.net/diff.php/phpdoc/en/reference/info/functions/get-magic-quotes-gpc.xml?r1=1.13&r2=1.14&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.13 phpdoc/en/reference/info/functions/get-magic-quotes-gpc.xml:1.14 --- phpdoc/en/reference/info/functions/get-magic-quotes-gpc.xml:1.13 Mon Sep 20 07:42:17 2004 +++ phpdoc/en/reference/info/functions/get-magic-quotes-gpc.xml Wed Nov 24 21:47:54 2004 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.13 $ --> +<!-- $Revision: 1.14 $ --> <!-- splitted from ./en/functions/info.xml, last change in rev 1.2 --> <refentry id="function.get-magic-quotes-gpc"> <refnamediv> @@ -58,38 +58,8 @@ </example> </para> <para> - In the interests of writing portable code (code that works - in any environment), or, if you do not have access to change - php.ini, you may wish to disable the effects of magic quotes - on a per-script basis. This can be done in two ways, with a - directive in a &htaccess; file (php_value magic_quotes_gpc 0), - or by adding the below code to the top of your scripts. - <example> - <title>Disabling magic quotes at runtime</title> - <programlisting role="php"> -<![CDATA[ -<?php -if (get_magic_quotes_gpc()) { - 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> - </example> - Magic-quotes was added to reduce code written by beginners from being dangerous. - If you disable magic quotes, you must be very careful to protect yourself from - SQL injection attacks. + For more information about magic_quotes, see this + <link linkend="security.magicquotes">security section</link>. </para> <simpara> See also <function>addslashes</function>,