Initial documentation

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@209148 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Jakub Vrana 2006-03-11 21:19:27 +00:00
parent 65b05d46d9
commit e8ac5a3af5
9 changed files with 1429 additions and 0 deletions

View file

@ -0,0 +1,34 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.1 $ -->
<section id="filter.installation">
&reftitle.install;
<para>
A short installation note: just type
<screen>
$ pear install filter
</screen>
in your console.
</para>
</section>
<!-- 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
-->

View file

@ -0,0 +1,537 @@
<?xml version='1.0' encoding='iso-8859-1'?>
<!-- $Revision: 1.1 $ -->
<!-- Generated by xml_proto.php v2.4. Found in /scripts directory of phpdoc. -->
<section id="filter.constants">
&reftitle.constants;
&extension.constants;
<variablelist>
<varlistentry>
<term>
<constant>INPUT_POST</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
<link linkend="reserved.variables.post">POST</link> variables.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>INPUT_GET</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
<link linkend="reserved.variables.get">GET</link> variables.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>INPUT_COOKIE</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
<link linkend="reserved.variables.cookies">COOKIE</link> variables.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>INPUT_ENV</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
<link linkend="reserved.variables.environment">ENV</link> variables.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>INPUT_SERVER</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
<link linkend="reserved.variables.server">SERVER</link> variables.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>INPUT_SESSION</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
<link linkend="reserved.variables.session">SESSION</link> variables.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>FILTER_FLAG_NONE</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
No flags.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>FILTER_VALIDATE_INT</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
ID of "int" filter.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>FILTER_VALIDATE_BOOLEAN</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
ID of "boolean" filter.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>FILTER_VALIDATE_FLOAT</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
ID of "float" filter.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>FILTER_VALIDATE_REGEXP</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
ID of "validate_regexp" filter.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>FILTER_VALIDATE_URL</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
ID of "validate_url" filter.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>FILTER_VALIDATE_EMAIL</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
ID of "validate_email" filter.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>FILTER_VALIDATE_IP</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
ID of "validate_ip" filter.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>FILTER_DEFAULT</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
ID of default ("string") filter.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>FILTER_UNSAFE_RAW</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
ID of "unsafe_raw" filter.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>FILTER_SANITIZE_STRING</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
ID of "string" filter.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>FILTER_SANITIZE_STRIPPED</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
ID of "stripped" filter.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>FILTER_SANITIZE_ENCODED</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
ID of "encoded" filter.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>FILTER_SANITIZE_SPECIAL_CHARS</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
ID of "special_chars" filter.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>FILTER_SANITIZE_EMAIL</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
ID of "email" filter.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>FILTER_SANITIZE_URL</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
ID of "url" filter.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>FILTER_SANITIZE_NUMBER_INT</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
ID of "number_int" filter.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>FILTER_SANITIZE_NUMBER_FLOAT</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
ID of "number_float" filter.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>FILTER_SANITIZE_MAGIC_QUOTES</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
ID of "magic_quotes" filter.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>FILTER_CALLBACK</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
ID of "callback" filter.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>FILTER_FLAG_ALLOW_OCTAL</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
Allow octal notation (<literal>0[0-7]+</literal>) in "int" filter.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>FILTER_FLAG_ALLOW_HEX</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
Allow hex notation (<literal>0x[0-9a-fA-F]+</literal>) in "int" filter.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>FILTER_FLAG_STRIP_LOW</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
Strip characters with ASCII value less than 32.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>FILTER_FLAG_STRIP_HIGH</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
Strip characters with ASCII value greater than 127.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>FILTER_FLAG_ENCODE_LOW</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
Encode characters with ASCII value less than 32.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>FILTER_FLAG_ENCODE_HIGH</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
Encode characters with ASCII value greater than 127.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>FILTER_FLAG_ENCODE_AMP</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
Encode <literal>&amp;</literal>.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>FILTER_FLAG_NO_ENCODE_QUOTES</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
Don't encode <literal>'</literal> and <literal>"</literal>.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>FILTER_FLAG_EMPTY_STRING_NULL</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
(No use for now.)
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>FILTER_FLAG_ALLOW_FRACTION</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
Allow fractional part in "number_float" filter.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>FILTER_FLAG_ALLOW_THOUSAND</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
Allow thousand separator (<literal>,</literal>) in "number_float" filter.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>FILTER_FLAG_ALLOW_SCIENTIFIC</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
Allow scientific notation (<literal>e</literal>, <literal>E</literal>) in
"number_float" filter.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>FILTER_FLAG_SCHEME_REQUIRED</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
Require scheme in "validate_url" filter.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>FILTER_FLAG_HOST_REQUIRED</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
Require host in "validate_url" filter.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>FILTER_FLAG_PATH_REQUIRED</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
Require path in "validate_url" filter.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>FILTER_FLAG_QUERY_REQUIRED</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
Require query in "validate_url" filter.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>FILTER_FLAG_IPV4</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
Allow only IPv4 address in "validate_ip" filter.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>FILTER_FLAG_IPV6</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
Allow only IPv6 address in "validate_ip" filter.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>FILTER_FLAG_NO_RES_RANGE</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
Deny reserved addresses in "validate_ip" filter.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>FILTER_FLAG_NO_PRIV_RANGE</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
Deny private addresses in "validate_ip" filter.
</simpara>
</listitem>
</varlistentry>
</variablelist>
</section>
<!-- 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
-->

View file

@ -0,0 +1,126 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.1 $ -->
<!-- Generated by xml_proto.php v2.4. Found in /scripts directory of phpdoc. -->
<refentry id="function.filter-data">
<refnamediv>
<refname>filter_data</refname>
<refpurpose>Filters data with a specified filter</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>mixed</type><methodname>filter_data</methodname>
<methodparam><type>mixed</type><parameter>variable</parameter></methodparam>
<methodparam><type>int</type><parameter>filter</parameter></methodparam>
<methodparam choice="opt"><type>mixed</type><parameter>filter_options</parameter></methodparam>
<methodparam choice="opt"><type>string</type><parameter>charset</parameter></methodparam>
</methodsynopsis>
&warn.experimental.func;
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>variable</parameter></term>
<listitem>
<para>
Value to filter, arrays are filtered resursivelly.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>filter</parameter></term>
<listitem>
<para>
ID of a filter to use.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>filter_options</parameter></term>
<listitem>
<para>
Associative array of options or bitwise disjunction of flags. If filter
accepts options, flags can be provided in "flags" field of array. For
the "callback" filter, <type>callback</type> type should be passed.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>charset</parameter></term>
<listitem>
<para>
Character set used for filtering. Currently no filter uses this
parameter.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns filtered data or &null; if filter fails.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>A <function>filter_data</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
var_dump(filter_data('bob@example.com', FILTER_VALIDATE_EMAIL));
var_dump(filter_data('example.com', FILTER_VALIDATE_URL, FILTER_FLAG_SCHEME_REQUIRED));
?>
]]>
</programlisting>
&example.outputs;
<screen>
<![CDATA[
string(15) "bob@example.com"
NULL
]]>
</screen>
</example>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>input_get</function></member>
<member>&seealso.callback;</member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- 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
-->

View file

@ -0,0 +1,96 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.1 $ -->
<!-- Generated by xml_proto.php v2.4. Found in /scripts directory of phpdoc. -->
<refentry id="function.input-filters-list">
<refnamediv>
<refname>input_filters_list</refname>
<refpurpose>Returns a list of all supported filters</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>array</type><methodname>input_filters_list</methodname>
<void/>
</methodsynopsis>
&warn.experimental.func;
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns an array of names of all supported filters, empty array if there
are no such filters. Indexes of this array are not filter IDs, they can be
obtained with <function>input_name_to_filter</function> from a name instead.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>A <function>input_filters_list</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
print_r(input_filters_list());
?>
]]>
</programlisting>
&example.outputs.similar;
<screen>
<![CDATA[
Array
(
[0] => int
[1] => boolean
[2] => float
[3] => validate_regexp
[4] => validate_url
[5] => validate_email
[6] => validate_ip
[7] => string
[8] => stripped
[9] => encoded
[10] => special_chars
[11] => unsafe_raw
[12] => email
[13] => url
[14] => number_int
[15] => number_float
[16] => magic_quotes
[17] => callback
)
]]>
</screen>
</example>
</para>
</refsect1>
</refentry>
<!-- 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
-->

View file

@ -0,0 +1,139 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.1 $ -->
<!-- Generated by xml_proto.php v2.4. Found in /scripts directory of phpdoc. -->
<refentry id="function.input-get">
<refnamediv>
<refname>input_get</refname>
<refpurpose>Gets variable from outside PHP and optionally filters it</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>mixed</type><methodname>input_get</methodname>
<methodparam><type>int</type><parameter>type</parameter></methodparam>
<methodparam><type>string</type><parameter>variable_name</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>filter</parameter></methodparam>
<methodparam choice="opt"><type>mixed</type><parameter>flags</parameter></methodparam>
<methodparam choice="opt"><type>string</type><parameter>charset</parameter></methodparam>
</methodsynopsis>
&warn.experimental.func;
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>type</parameter></term>
<listitem>
<para>
One of <constant>INPUT_GET</constant>, <constant>INPUT_POST</constant>,
<constant>INPUT_COOKIE</constant>, <constant>INPUT_SERVER</constant>,
<constant>INPUT_ENV</constant>, <constant>INPUT_SESSION</constant> (not
implemented yet) and 99 (serves for REQUEST for now).
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>variable_name</parameter></term>
<listitem>
<para>
Name of a variable to get.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>filter</parameter></term>
<listitem>
<para>
Filter to apply.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>flags</parameter></term>
<listitem>
<para>
Associative array of options or bitwise disjunction of flags. If filter
accepts options, flags can be provided in "flags" field of array.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>charset</parameter></term>
<listitem>
<para>
Character set used for filtering. Currently no filter uses this
parameter.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Value of the requested variable on success or &false; if variable has not
been found.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>A <function>input_get</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
$search_html = input_get(INPUT_GET, 'search', FILTER_SANITIZE_SPECIAL_CHARS);
$search_url = input_get(INPUT_GET, 'search', FILTER_SANITIZE_ENCODED);
echo "You have searched for $search_html.\n";
echo "<a href='?search=$search_url'>Search again.</a>";
?>
]]>
</programlisting>
&example.outputs.similar;
<screen>
<![CDATA[
You have searched for Me &#38; son.
<a href='?search=Me%20%26%20son'>Search again.</a>
]]>
</screen>
</example>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>filter_data</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- 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
-->

View file

@ -0,0 +1,73 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.1 $ -->
<!-- Generated by xml_proto.php v2.4. Found in /scripts directory of phpdoc. -->
<refentry id="function.input-has-variable">
<refnamediv>
<refname>input_has_variable</refname>
<refpurpose>Checks if variable of specified type exists</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>bool</type><methodname>input_has_variable</methodname>
<methodparam><type>int</type><parameter>type</parameter></methodparam>
<methodparam><type>string</type><parameter>variable_name</parameter></methodparam>
</methodsynopsis>
&warn.experimental.func;
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>type</parameter></term>
<listitem>
<para>
One of <constant>INPUT_GET</constant>, <constant>INPUT_POST</constant>,
<constant>INPUT_COOKIE</constant>, <constant>INPUT_SERVER</constant>,
<constant>INPUT_ENV</constant>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>variable_name</parameter></term>
<listitem>
<para>
Name of a variable to check.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
&return.success;
</para>
</refsect1>
</refentry>
<!-- 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
-->

View file

@ -0,0 +1,71 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.1 $ -->
<!-- Generated by xml_proto.php v2.4. Found in /scripts directory of phpdoc. -->
<refentry id="function.input-name-to-filter">
<refnamediv>
<refname>input_name_to_filter</refname>
<refpurpose>Returns the filter ID belonging to a named filter</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>int</type><methodname>input_name_to_filter</methodname>
<methodparam><type>string</type><parameter>filtername</parameter></methodparam>
</methodsynopsis>
&warn.experimental.func;
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>filtername</parameter></term>
<listitem>
<para>
Name of a filter to get.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
ID of a filter on success or &null; if filter doesn't exist.
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>input_filters_list</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- 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
-->

88
reference/filter/ini.xml Normal file
View file

@ -0,0 +1,88 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.1 $ -->
<section id="filter.configuration">
&reftitle.runtime;
&extension.runtime;
<para>
<table>
<title>Filter Configuration Options</title>
<tgroup cols="4">
<thead>
<row>
<entry>Name</entry>
<entry>Default</entry>
<entry>Changeable</entry>
<entry>Changelog</entry>
</row>
</thead>
<tbody>
<row>
<entry>filter.default</entry>
<entry>string</entry>
<entry>PHP_INI_ALL</entry>
<entry></entry>
</row>
<row>
<entry>filter.default-flags</entry>
<entry></entry>
<entry>PHP_INI_ALL</entry>
<entry></entry>
</row>
</tbody>
</tgroup>
</table>
&ini.php.constants;
</para>
&ini.descriptions.title;
<para>
<variablelist>
<varlistentry id="ini.filter.default">
<term>
<parameter>filter.default</parameter>
<type>string</type>
</term>
<listitem>
<para>
Filter all GET, POST, COOKIE (and REQUEST) data by this filter.
</para>
</listitem>
</varlistentry>
<varlistentry id="ini.filter.default-flags">
<term>
<parameter>filter.default_flags</parameter>
<type>integer</type>
</term>
<listitem>
<para>
Default flags for <function>filter_data</function>.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</section>
<!-- 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
-->

View file

@ -0,0 +1,265 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.1 $ -->
<!-- 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>'"&lt;&gt;&amp;</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>!#$%&amp;'*+-/=?^_`{|}~@.[]</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>$-_.+!*'(),{}|\\^~[]`&lt;&gt;#%";/?:@&amp;=</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
-->