Document get_magic_quotes_* behaviour as of 5.4.0, which always returns false (instead of 0), which is due to our collective failure as a PHP team.

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@325516 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Philip Olson 2012-05-03 17:42:14 +00:00
parent 6eb1cef4f2
commit 098fcff39a
2 changed files with 54 additions and 3 deletions

View file

@ -9,7 +9,7 @@
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>int</type><methodname>get_magic_quotes_gpc</methodname>
<type>bool</type><methodname>get_magic_quotes_gpc</methodname>
<void/>
</methodsynopsis>
<para>
@ -30,6 +30,31 @@
&reftitle.returnvalues;
<para>
Returns 0 if magic_quotes_gpc is off, 1 otherwise.
Or always returns &false; as of PHP 5.4.0.
</para>
</refsect1>
<refsect1 role="changelog">
&reftitle.changelog;
<para>
<informaltable>
<tgroup cols="2">
<thead>
<row>
<entry>&Version;</entry>
<entry>&Description;</entry>
</row>
</thead>
<tbody>
<row>
<entry>5.4.0</entry>
<entry>
Always returns &false; because the magic quotes feature was removed from PHP.
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</para>
</refsect1>
@ -41,10 +66,11 @@
<programlisting role="php">
<![CDATA[
<?php
echo get_magic_quotes_gpc(); // 1
// If magic quotes are enabled
echo $_POST['lastname']; // O\'reilly
echo addslashes($_POST['lastname']); // O\\\'reilly
// Usage across all PHP versions
if (get_magic_quotes_gpc()) {
$lastname = stripslashes($_POST['lastname']);
}

View file

@ -9,7 +9,7 @@
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>int</type><methodname>get_magic_quotes_runtime</methodname>
<type>bool</type><methodname>get_magic_quotes_runtime</methodname>
<void/>
</methodsynopsis>
<simpara>
@ -22,9 +22,34 @@
&reftitle.returnvalues;
<para>
Returns 0 if magic_quotes_runtime is off, 1 otherwise.
Or always returns &false; as of PHP 5.4.0.
</para>
</refsect1>
<refsect1 role="changelog">
&reftitle.changelog;
<para>
<informaltable>
<tgroup cols="2">
<thead>
<row>
<entry>&Version;</entry>
<entry>&Description;</entry>
</row>
</thead>
<tbody>
<row>
<entry>5.4.0</entry>
<entry>
Always returns &false; because the magic quotes feature was removed from PHP.
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>