Added documentation for filter flags (PHP bug #51371)

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@296717 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Daniel Egeberg 2010-03-24 14:07:53 +00:00
parent af30b34cfd
commit 04488897de

View file

@ -3,6 +3,7 @@
<chapter xml:id="filter.filters" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>Types of filters</title>
<!--Validate filters: {{{-->
<section xml:id='filter.filters.validate'>
<title>Validate filters</title>
<para>
@ -116,7 +117,9 @@
</para>
</note>
</section>
<!--}}}-->
<!-- Sanitize filters: {{{-->
<section xml:id='filter.filters.sanitize'>
<title>Sanitize filters</title>
<para>
@ -249,7 +252,9 @@
</table>
</para>
</section>
<!--}}}-->
<!-- Other filters: {{{-->
<section xml:id='filter.filters.misc'>
<title>Other filters</title>
<para>
@ -278,6 +283,224 @@
</table>
</para>
</section>
<!--}}}-->
<!-- Filter flags: {{{-->
<section xml:id="filter.filters.flags">
<title>Filter flags</title>
<para>
<table>
<title>List of filter flags</title>
<tgroup cols="3">
<thead>
<row>
<entry>ID</entry>
<entry>Used with</entry>
<entry>Description</entry>
</row>
</thead>
<tbody>
<row>
<entry><constant>FILTER_FLAG_STRIP_LOW</constant></entry>
<entry>
<constant>FILTER_SANITIZE_ENCODED</constant>,
<constant>FILTER_SANITIZE_SPECIAL_CHARS</constant>,
<constant>FILTER_SANITIZE_STRING</constant>,
<constant>FILTER_UNSAFE_RAW</constant>
</entry>
<entry>
Strips characters that has a numerical value &lt;32.
</entry>
</row>
<row>
<entry><constant>FILTER_FLAG_STRIP_HIGH</constant></entry>
<entry>
<constant>FILTER_SANITIZE_ENCODED</constant>,
<constant>FILTER_SANITIZE_SPECIAL_CHARS</constant>,
<constant>FILTER_SANITIZE_STRING</constant>,
<constant>FILTER_UNSAFE_RAW</constant>
</entry>
<entry>
Strips characters that has a numerical value &gt;127.
</entry>
</row>
<row>
<entry><constant>FILTER_FLAG_ALLOW_FRACTION</constant></entry>
<entry>
<constant>FILTER_SANITIZE_NUMBER_FLOAT</constant>
</entry>
<entry>
Allows a period (<literal>.</literal>) as a fractional separator in
numbers.
</entry>
</row>
<row>
<entry><constant>FILTER_FLAG_ALLOW_THOUSAND</constant></entry>
<entry>
<constant>FILTER_SANITIZE_NUMBER_FLOAT</constant>,
<constant>FILTER_VALIDATE_FLOAT</constant>
</entry>
<entry>
Allows a comma (<literal>,</literal>) as a thousands separator in
numbers.
</entry>
</row>
<row>
<entry><constant>FILTER_FLAG_ALLOW_SCIENTIFIC</constant></entry>
<entry>
<constant>FILTER_SANITIZE_NUMBER_FLOAT</constant>
</entry>
<entry>
Allows an <literal>e</literal> or <literal>E</literal> for scientific
notation in numbers.
</entry>
</row>
<row>
<entry><constant>FILTER_FLAG_NO_ENCODE_QUOTES</constant></entry>
<entry>
<constant>FILTER_SANITIZE_STRING</constant>
</entry>
<entry>
If this flag is present, single (<literal>'</literal>) and double
(<literal>"</literal>) quotes will not be encoded.
</entry>
</row>
<row>
<entry><constant>FILTER_FLAG_ENCODE_LOW</constant></entry>
<entry>
<constant>FILTER_SANITIZE_ENCODED</constant>,
<constant>FILTER_SANITIZE_STRING</constant>,
<constant>FILTER_SANITIZE_RAW</constant>
</entry>
<entry>
Encodes all characters with a numerical value &lt;32.
</entry>
</row>
<row>
<entry><constant>FILTER_FLAG_NO_ENCODE_HIGH</constant></entry>
<entry>
<constant>FILTER_SANITIZE_ENCODED</constant>,
<constant>FILTER_SANITIZE_SPECIAL_CHARS</constant>,
<constant>FILTER_SANITIZE_STRING</constant>,
<constant>FILTER_SANITIZE_RAW</constant>
</entry>
<entry>
Encodes all characters with a numerical value &gt;127.
</entry>
</row>
<row>
<entry><constant>FILTER_FLAG_NO_ENCODE_AMP</constant></entry>
<entry>
<constant>FILTER_SANITIZE_STRING</constant>,
<constant>FILTER_SANITIZE_RAW</constant>
</entry>
<entry>
Encodes ampersands (<literal>&amp;</literal>).
</entry>
</row>
<row>
<entry><constant>FILTER_NULL_ON_FAILURE</constant></entry>
<entry>
<constant>FILTER_VALIDATE_BOOLEAN</constant>
</entry>
<entry>
Returns &null; for unrecognized boolean values.
</entry>
</row>
<row>
<entry><constant>FILTER_FLAG_ALLOW_OCTAL</constant></entry>
<entry>
<constant>FILTER_VALIDATE_INT</constant>
</entry>
<entry>
Regards inputs starting with a zero (<literal>0</literal>) as octal
numbers. This only allows the preceding digits to be
<literal>0-7</literal>.
</entry>
</row>
<row>
<entry><constant>FILTER_FLAG_ALLOW_HEX</constant></entry>
<entry>
<constant>FILTER_VALIDATE_INT</constant>
</entry>
<entry>
Regards inputs starting with <literal>0x</literal> or
<literal>0X</literal> as hexadecimal numbers. This only allows
preceding characters to be <literal>a-hA-H0-9</literal>.
</entry>
</row>
<row>
<entry><constant>FILTER_FLAG_IPV4</constant></entry>
<entry>
<constant>FILTER_VALIDATE_IP</constant>
</entry>
<entry>
Allows the IP address to be in IPv4 format.
</entry>
</row>
<row>
<entry><constant>FILTER_FLAG_IPV6</constant></entry>
<entry>
<constant>FILTER_VALIDATE_IP</constant>
</entry>
<entry>
Allows the IP address to be in IPv6 format.
</entry>
</row>
<row>
<entry><constant>FILTER_FLAG_NO_PRIV_RANGE</constant></entry>
<entry>
<constant>FILTER_VALIDATE_IP</constant>
</entry>
<entry>
<para>
Fails validation for the following private IPv4 ranges:
<literal>10.0.0.0/8</literal>, <literal>172.16.0.0/12</literal> and
<literal>192.168.0.0/16</literal>.
</para>
<para>
Fails validation for the IPv6 addresses starting with
<literal>FD</literal> or <literal>FC</literal>.
</para>
</entry>
</row>
<row>
<entry><constant>FILTER_FLAG_NO_RES_RANGE</constant></entry>
<entry>
<constant>FILTER_VALIDATE_IP</constant>
</entry>
<entry>
Fails validation for the following reserved IPv4 ranges:
<literal>0.0.0.0/8</literal>, <literal>169.254.0.0/16</literal>,
<literal>192.0.2.0/24</literal> and <literal>224.0.0.0/4</literal>.
This flag does not apply to IPv6 addresses.
</entry>
</row>
<row>
<entry><constant>FILTER_FLAG_PATH_REQUIRED</constant></entry>
<entry>
<constant>FILTER_VALIDATE_URL</constant>
</entry>
<entry>
Requires the <acronym>URL</acronym> to contain a path part.
</entry>
</row>
<row>
<entry><constant>FILTER_FLAG_QUERY_REQUIRED</constant></entry>
<entry>
<constant>FILTER_VALIDATE_URL</constant>
</entry>
<entry>
Requires the <acronym>URL</acronym> to contain a query string.
</entry>
</row>
</tbody>
</tgroup>
</table>
</para>
</section>
<!--}}}-->
</chapter>
<!-- Keep this comment at the end of the file
@ -296,7 +519,7 @@ sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim600: syn=xml fen fdm=marker fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->