mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-15 16:38:54 +00:00
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:
parent
6eb1cef4f2
commit
098fcff39a
2 changed files with 54 additions and 3 deletions
|
@ -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']);
|
||||
}
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Reference in a new issue