mirror of
https://github.com/macintoshplus/doc-en.git
synced 2026-04-28 11:13:24 +02:00
a5e082b328
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@209161 c90b9560-bf6c-de11-be94-00142212c4b1
266 lines
7.9 KiB
XML
266 lines
7.9 KiB
XML
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
<!-- $Revision: 1.2 $ -->
|
|
<!-- Purpose: basic.vartype -->
|
|
<!-- Membership: pecl -->
|
|
<!-- Generated by xml_proto.php v2.4. Found in /scripts directory of phpdoc. -->
|
|
<reference id="ref.filter">
|
|
<title>Filter Functions</title>
|
|
<titleabbrev>Filter</titleabbrev>
|
|
|
|
<partintro>
|
|
<section id="filter.intro">
|
|
&reftitle.intro;
|
|
<para>
|
|
This extension serves for validating and filtering data coming usually
|
|
from some insecure source such as user input.
|
|
</para>
|
|
&warn.experimental;
|
|
<para>
|
|
Following filters currently exist:
|
|
<table>
|
|
<title>Existing filters</title>
|
|
<tgroup cols="4">
|
|
<thead>
|
|
<row>
|
|
<entry>ID</entry>
|
|
<entry>Name</entry>
|
|
<entry>Options</entry>
|
|
<entry>Flags</entry>
|
|
<entry>Description</entry>
|
|
</row>
|
|
</thead>
|
|
<tbody>
|
|
<row>
|
|
<entry>FILTER_VALIDATE_INT</entry>
|
|
<entry>int</entry>
|
|
<entry>
|
|
<parameter>min_range</parameter>,
|
|
<parameter>max_range</parameter>
|
|
</entry>
|
|
<entry>
|
|
<constant>FILTER_FLAG_ALLOW_OCTAL</constant>,
|
|
<constant>FILTER_FLAG_ALLOW_HEX</constant>
|
|
</entry>
|
|
<entry>Validates value as integer, optionally from the specified range.</entry>
|
|
</row>
|
|
<row>
|
|
<entry>FILTER_VALIDATE_BOOLEAN</entry>
|
|
<entry>boolean</entry>
|
|
<entry></entry>
|
|
<entry></entry>
|
|
<entry>
|
|
Returns &true; for "1", "true", "on" and "yes",
|
|
&false; for "0", "false", "off", "no", and "",
|
|
&null; otherwise.
|
|
</entry>
|
|
</row>
|
|
<row>
|
|
<entry>FILTER_VALIDATE_FLOAT</entry>
|
|
<entry>float</entry>
|
|
<entry></entry>
|
|
<entry></entry>
|
|
<entry>Validates value as float.</entry>
|
|
</row>
|
|
|
|
<row>
|
|
<entry>FILTER_VALIDATE_REGEXP</entry>
|
|
<entry>validate_regexp</entry>
|
|
<entry>
|
|
<parameter>regexp</parameter>
|
|
</entry>
|
|
<entry></entry>
|
|
<entry>Validates value against regexp.</entry>
|
|
</row>
|
|
<row>
|
|
<entry>FILTER_VALIDATE_URL</entry>
|
|
<entry>validate_url</entry>
|
|
<entry></entry>
|
|
<entry>
|
|
<constant>FILTER_FLAG_SCHEME_REQUIRED</constant>,
|
|
<constant>FILTER_FLAG_HOST_REQUIRED</constant>,
|
|
<constant>FILTER_FLAG_PATH_REQUIRED</constant>,
|
|
<constant>FILTER_FLAG_QUERY_REQUIRED</constant>
|
|
</entry>
|
|
<entry>Validates value as URL, optionally with required components.</entry>
|
|
</row>
|
|
<row>
|
|
<entry>FILTER_VALIDATE_EMAIL</entry>
|
|
<entry>validate_email</entry>
|
|
<entry></entry>
|
|
<entry></entry>
|
|
<entry>Validates value as e-mail.</entry>
|
|
</row>
|
|
<row>
|
|
<entry>FILTER_VALIDATE_IP</entry>
|
|
<entry>validate_ip</entry>
|
|
<entry></entry>
|
|
<entry>
|
|
<constant>FILTER_FLAG_IPV4</constant>,
|
|
<constant>FILTER_FLAG_IPV6</constant>,
|
|
<constant>FILTER_FLAG_NO_PRIV_RANGE</constant>,
|
|
<constant>FILTER_FLAG_NO_RES_RANGE</constant>
|
|
</entry>
|
|
<entry>
|
|
Validates value as IP address, optionally only IPv4 or IPv6 or not
|
|
from private or reserved ranges.
|
|
</entry>
|
|
</row>
|
|
|
|
<row>
|
|
<entry>FILTER_SANITIZE_STRING</entry>
|
|
<entry>string</entry>
|
|
<entry></entry>
|
|
<entry>
|
|
<constant>FILTER_FLAG_NO_ENCODE_QUOTES</constant>,
|
|
<constant>FILTER_FLAG_STRIP_LOW</constant>,
|
|
<constant>FILTER_FLAG_STRIP_HIGH</constant>,
|
|
<constant>FILTER_FLAG_ENCODE_LOW</constant>,
|
|
<constant>FILTER_FLAG_ENCODE_HIGH</constant>,
|
|
<constant>FILTER_FLAG_ENCODE_AMP</constant>
|
|
</entry>
|
|
<entry>Strip tags, optionally strip or encode special characters.</entry>
|
|
</row>
|
|
<row>
|
|
<entry>FILTER_SANITIZE_STRIPPED</entry>
|
|
<entry>stripped</entry>
|
|
<entry></entry>
|
|
<entry></entry>
|
|
<entry>Alias of "string" filter.</entry>
|
|
</row>
|
|
<row>
|
|
<entry>FILTER_SANITIZE_ENCODED</entry>
|
|
<entry>encoded</entry>
|
|
<entry></entry>
|
|
<entry>
|
|
<constant>FILTER_FLAG_STRIP_LOW</constant>,
|
|
<constant>FILTER_FLAG_STRIP_HIGH</constant>,
|
|
<constant>FILTER_FLAG_ENCODE_LOW</constant>,
|
|
<constant>FILTER_FLAG_ENCODE_HIGH</constant>
|
|
</entry>
|
|
<entry>URL-encode string, optionally strip or encode special characters.</entry>
|
|
</row>
|
|
<row>
|
|
<entry>FILTER_SANITIZE_SPECIAL_CHARS</entry>
|
|
<entry>special_chars</entry>
|
|
<entry></entry>
|
|
<entry>
|
|
<constant>FILTER_FLAG_STRIP_LOW</constant>,
|
|
<constant>FILTER_FLAG_STRIP_HIGH</constant>,
|
|
<constant>FILTER_FLAG_ENCODE_HIGH</constant>
|
|
</entry>
|
|
<entry>
|
|
HTML-escape <literal>'"<>&</literal> and characters with
|
|
ASCII value less than 32, optionally strip or encode other special
|
|
characters.
|
|
</entry>
|
|
</row>
|
|
<row>
|
|
<entry>FILTER_UNSAFE_RAW</entry>
|
|
<entry>unsafe_raw</entry>
|
|
<entry></entry>
|
|
<entry>
|
|
<constant>FILTER_FLAG_STRIP_LOW</constant>,
|
|
<constant>FILTER_FLAG_STRIP_HIGH</constant>,
|
|
<constant>FILTER_FLAG_ENCODE_LOW</constant>,
|
|
<constant>FILTER_FLAG_ENCODE_HIGH</constant>,
|
|
<constant>FILTER_FLAG_ENCODE_AMP</constant>
|
|
</entry>
|
|
<entry>Do nothing, optionally strip or encode special characters.</entry>
|
|
</row>
|
|
<row>
|
|
<entry>FILTER_SANITIZE_EMAIL</entry>
|
|
<entry>email</entry>
|
|
<entry></entry>
|
|
<entry></entry>
|
|
<entry>
|
|
Remove all characters except letters, digits and
|
|
<literal>!#$%&'*+-/=?^_`{|}~@.[]</literal>.
|
|
</entry>
|
|
</row>
|
|
<row>
|
|
<entry>FILTER_SANITIZE_URL</entry>
|
|
<entry>url</entry>
|
|
<entry></entry>
|
|
<entry></entry>
|
|
<entry>
|
|
Remove all characters except letters, digits and
|
|
<literal>$-_.+!*'(),{}|\\^~[]`<>#%";/?:@&=</literal>.
|
|
</entry>
|
|
</row>
|
|
<row>
|
|
<entry>FILTER_SANITIZE_NUMBER_INT</entry>
|
|
<entry>number_int</entry>
|
|
<entry></entry>
|
|
<entry></entry>
|
|
<entry>
|
|
Remove all characters except digits and <literal>+-</literal>.
|
|
</entry>
|
|
</row>
|
|
<row>
|
|
<entry>FILTER_SANITIZE_NUMBER_FLOAT</entry>
|
|
<entry>number_float</entry>
|
|
<entry></entry>
|
|
<entry></entry>
|
|
<entry>
|
|
Remove all characters except digits, <literal>+-</literal> and
|
|
optionally <literal>.,eE</literal>.
|
|
</entry>
|
|
</row>
|
|
<row>
|
|
<entry>FILTER_SANITIZE_MAGIC_QUOTES</entry>
|
|
<entry>magic_quotes</entry>
|
|
<entry></entry>
|
|
<entry></entry>
|
|
<entry>Apply <function>addslashes</function>.</entry>
|
|
</row>
|
|
|
|
<row>
|
|
<entry>FILTER_CALLBACK</entry>
|
|
<entry>callback</entry>
|
|
<entry></entry>
|
|
<entry><type>callback</type> function or method</entry>
|
|
<entry>Call user-defined function to filter data.</entry>
|
|
</row>
|
|
</tbody>
|
|
</tgroup>
|
|
</table>
|
|
</para>
|
|
</section>
|
|
<section id="filter.requirements">
|
|
&reftitle.required;
|
|
&no.requirement;
|
|
</section>
|
|
|
|
&reference.filter.configure;
|
|
&reference.filter.ini;
|
|
|
|
<section id="filter.resources">
|
|
&reftitle.resources;
|
|
&no.resource;
|
|
</section>
|
|
&reference.filter.constants;
|
|
</partintro>
|
|
&reference.filter.functions;
|
|
</reference>
|
|
|
|
<!-- Keep this comment at the end of the file
|
|
Local variables:
|
|
mode: sgml
|
|
sgml-omittag:t
|
|
sgml-shorttag:t
|
|
sgml-minimize-attributes:nil
|
|
sgml-always-quote-attributes:t
|
|
sgml-indent-step:1
|
|
sgml-indent-data:t
|
|
indent-tabs-mode:nil
|
|
sgml-parent-document:nil
|
|
sgml-default-dtd-file:"../../../manual.ced"
|
|
sgml-exposed-tags:nil
|
|
sgml-local-catalogs:nil
|
|
sgml-local-ecat-files:nil
|
|
End:
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
vim: et tw=78 syn=sgml
|
|
vi: ts=1 sw=1
|
|
-->
|