svn: /phpdoc/en/trunk/reference/strings/functions/ htmlentities.xml htmlspecialchars.xml
| From: | Nikita Popov | Date: | Sat, 17 Sep 2011 11:32:28 +0000 |
| Subject: | svn: /phpdoc/en/trunk/reference/strings/functions/ htmlentities.xml htmlspecialchars.xml | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-8820@lists.php.net to get a copy of this message | ||
nikic Sat, 17 Sep 2011 11:32:28 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=316908
Log:
Fix Doc Bug #55547: Undocumented flags for htmlentities()
Bug: https://bugs.php.net/55547 (Open) Undocumented flags
for htmlentities()
Changed paths:
U phpdoc/en/trunk/reference/strings/functions/htmlentities.xml
U phpdoc/en/trunk/reference/strings/functions/htmlspecialchars.xml
Modified: phpdoc/en/trunk/reference/strings/functions/htmlentities.xml
===================================================================
--- phpdoc/en/trunk/reference/strings/functions/htmlentities.xml 2011-09-17 10:29:44 UTC (rev
316907)
+++ phpdoc/en/trunk/reference/strings/functions/htmlentities.xml 2011-09-17 11:32:28 UTC (rev
316908)
@@ -42,12 +42,9 @@
<term><parameter>flags</parameter></term>
<listitem>
<para>
- Like <function>htmlspecialchars</function>, the optional second
- <parameter>flags</parameter> parameter lets you define what will
- be done with 'single' and "double" quotes. It takes on one of three
- constants with the default being <constant>ENT_COMPAT</constant>,
- optionally combined with a fourth <constant>ENT_IGNORE</constant> (since
- PHP 5.3.0):
+ A bitmask of one or more of the following flags, which specify how to handle quotes,
+ invalid code unit sequences and the used document type. The default is
+ <literal>ENT_COMPAT | ENT_HTML401</literal>.
<table>
<title>Available <parameter>flags</parameter> constants</title>
<tgroup cols="2">
@@ -78,6 +75,44 @@
compatibility; avoid using it as it may have security implications.
</entry>
</row>
+ <row>
+ <entry><constant>ENT_SUBSTITUTE</constant></entry>
+ <entry>
+ Replace invalid code unit sequences with a Unicode Replacement Character
+ U+FFFD (UTF-8) or &#FFFD; (otherwise) instead of returning an empty string.
+ </entry>
+ </row>
+ <row>
+ <entry><constant>ENT_DISALLOWED</constant></entry>
+ <entry>
+ Replace code unit sequences, which are invalid in the specified document type,
+ with a Unicode Replacement Character U+FFFD (UTF-8) or &#FFFD; (otherwise).
+ </entry>
+ </row>
+ <row>
+ <entry><constant>ENT_HTML401</constant></entry>
+ <entry>
+ Handle code as HTML 4.01.
+ </entry>
+ </row>
+ <row>
+ <entry><constant>ENT_XML1</constant></entry>
+ <entry>
+ Handle code as XML 1.
+ </entry>
+ </row>
+ <row>
+ <entry><constant>ENT_XHTML</constant></entry>
+ <entry>
+ Handle code as XHTML.
+ </entry>
+ </row>
+ <row>
+ <entry><constant>ENT_HTML5</constant></entry>
+ <entry>
+ Handle code as HTML 5.
+ </entry>
+ </row>
</tbody>
</tgroup>
</table>
Modified: phpdoc/en/trunk/reference/strings/functions/htmlspecialchars.xml
===================================================================
--- phpdoc/en/trunk/reference/strings/functions/htmlspecialchars.xml 2011-09-17 10:29:44 UTC (rev
316907)
+++ phpdoc/en/trunk/reference/strings/functions/htmlspecialchars.xml 2011-09-17 11:32:28 UTC (rev
316908)
@@ -79,18 +79,80 @@
<term><parameter>flags</parameter></term>
<listitem>
<para>
- The optional second argument, <parameter>flags</parameter>, tells
- the function what to do with single and double quote characters and with
- invalid multi-byte sequences.
- The default mode, <constant>ENT_COMPAT</constant>, is the backwards compatible
mode
- which only translates the double-quote character and leaves the
- single-quote untranslated. If <constant>ENT_QUOTES</constant> is set, both
single and
- double quotes are translated and if <constant>ENT_NOQUOTES</constant> is set
neither
- single nor double quotes are translated.
- In addition, since 5.3.0, these constants can be combined with
- <constant>ENT_IGNORE</constant>. In that case, strings that contain invalid code
unit
- sequences have those invalid sequences discarded instead of having the function
- return an empty string. Avoid using it, as it may have introduce vulnerabilities.
+ A bitmask of one or more of the following flags, which specify how to handle quotes,
+ invalid code unit sequences and the used document type. The default is
+ <literal>ENT_COMPAT | ENT_HTML401</literal>.
+ <table>
+ <title>Available <parameter>flags</parameter> constants</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Constant Name</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry><constant>ENT_COMPAT</constant></entry>
+ <entry>Will convert double-quotes and leave single-quotes alone.</entry>
+ </row>
+ <row>
+ <entry><constant>ENT_QUOTES</constant></entry>
+ <entry>Will convert both double and single quotes.</entry>
+ </row>
+ <row>
+ <entry><constant>ENT_NOQUOTES</constant></entry>
+ <entry>Will leave both double and single quotes unconverted.</entry>
+ </row>
+ <row>
+ <entry><constant>ENT_IGNORE</constant></entry>
+ <entry>
+ Silently discard invalid code unit sequences instead of returning
+ an empty string. Added in PHP 5.3.0. This is provided for backwards
+ compatibility; avoid using it as it may have security implications.
+ </entry>
+ </row>
+ <row>
+ <entry><constant>ENT_SUBSTITUTE</constant></entry>
+ <entry>
+ Replace invalid code unit sequences with a Unicode Replacement Character
+ U+FFFD (UTF-8) or &#FFFD; (otherwise) instead of returning an empty string.
+ </entry>
+ </row>
+ <row>
+ <entry><constant>ENT_DISALLOWED</constant></entry>
+ <entry>
+ Replace code unit sequences, which are invalid in the specified document type,
+ with a Unicode Replacement Character U+FFFD (UTF-8) or &#FFFD; (otherwise).
+ </entry>
+ </row>
+ <row>
+ <entry><constant>ENT_HTML401</constant></entry>
+ <entry>
+ Handle code as HTML 4.01.
+ </entry>
+ </row>
+ <row>
+ <entry><constant>ENT_XML1</constant></entry>
+ <entry>
+ Handle code as XML 1.
+ </entry>
+ </row>
+ <row>
+ <entry><constant>ENT_XHTML</constant></entry>
+ <entry>
+ Handle code as XHTML.
+ </entry>
+ </row>
+ <row>
+ <entry><constant>ENT_HTML5</constant></entry>
+ <entry>
+ Handle code as HTML 5.
+ </entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
</para>
</listitem>
</varlistentry>