mirror of
https://github.com/php/doc-es.git
synced 2026-04-23 23:28:22 +02:00
80920f7051
git-svn-id: https://svn.php.net/repository/phpdoc/es/trunk@338572 c90b9560-bf6c-de11-be94-00142212c4b1
662 lines
21 KiB
XML
662 lines
21 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<!-- EN-Revision: 5a8a3c027c90b0118a0c4ec2c63cbcdcaefc287b Maintainer: seros Status: in progress -->
|
|
<!-- Reviewed: no -->
|
|
<chapter xml:id="filter.filters" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
<title>Tipos de filtros</title>
|
|
|
|
<!--Validate filters: {{{-->
|
|
<section xml:id="filter.filters.validate">
|
|
<title>Filtros de validación</title>
|
|
<para>
|
|
<table>
|
|
<title>Listado de filtros para validación</title>
|
|
<tgroup cols="5">
|
|
<thead>
|
|
<row>
|
|
<entry>ID</entry>
|
|
<entry>Nombre</entry>
|
|
<entry>Opciones</entry>
|
|
<entry>Banderas</entry>
|
|
<entry>Descripción</entry>
|
|
</row>
|
|
</thead>
|
|
<tbody>
|
|
<row>
|
|
<entry><constant>FILTER_VALIDATE_BOOLEAN</constant></entry>
|
|
<entry>"boolean"</entry>
|
|
<entry>
|
|
<parameter>default</parameter>
|
|
</entry>
|
|
<entry>
|
|
<constant>FILTER_NULL_ON_FAILURE</constant>
|
|
</entry>
|
|
<entry>
|
|
<para>
|
|
Devuelve &true; para "1", "true", "on" y "yes".
|
|
Devuelve &false; en caso contrario.
|
|
</para>
|
|
<para>
|
|
Si <constant>FILTER_NULL_ON_FAILURE</constant> está declarado, se
|
|
devolverá &false; sólo para "0", "false", "off", "no", y "", y &null;
|
|
para cualquier valor no booleano.
|
|
</para>
|
|
</entry>
|
|
</row>
|
|
<row>
|
|
<entry><constant>FILTER_VALIDATE_EMAIL</constant></entry>
|
|
<entry>"validate_email"</entry>
|
|
<entry>
|
|
<parameter>default</parameter>
|
|
</entry>
|
|
<entry></entry>
|
|
<entry>
|
|
<para>
|
|
Valida una dirección de correo electrónico.
|
|
</para>
|
|
<para>
|
|
En general, se valildan direcciones de correo electrónico con la sintaxis de
|
|
RFC 822, con la excepción de no admitir el plegamiento de comentarios y
|
|
espacios en blanco.
|
|
</para>
|
|
</entry>
|
|
</row>
|
|
<row>
|
|
<entry><constant>FILTER_VALIDATE_FLOAT</constant></entry>
|
|
<entry>"float"</entry>
|
|
<entry>
|
|
<parameter>default</parameter>,
|
|
<parameter>decimal</parameter>
|
|
</entry>
|
|
<entry>
|
|
<constant>FILTER_FLAG_ALLOW_THOUSAND</constant>
|
|
</entry>
|
|
<entry>Valida si el valor es un float.</entry>
|
|
</row>
|
|
<row>
|
|
<entry><constant>FILTER_VALIDATE_INT</constant></entry>
|
|
<entry>"int"</entry>
|
|
<entry>
|
|
<parameter>default</parameter>,
|
|
<parameter>min_range</parameter>,
|
|
<parameter>max_range</parameter>
|
|
</entry>
|
|
<entry>
|
|
<constant>FILTER_FLAG_ALLOW_OCTAL</constant>,
|
|
<constant>FILTER_FLAG_ALLOW_HEX</constant>
|
|
</entry>
|
|
<entry>Valida un valor como integer, opcionalmente desde el rango especificado, y lo convierte a int en case de éxito.</entry>
|
|
</row>
|
|
<row>
|
|
<entry><constant>FILTER_VALIDATE_IP</constant></entry>
|
|
<entry>"validate_ip"</entry>
|
|
<entry>
|
|
<parameter>default</parameter>
|
|
</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>
|
|
Valida si es valor es una dirección IP, opcionalmente se puede indicar que sea sólo IPv4 o IPv6 o que no
|
|
sea de rangos privados o reservados.
|
|
</entry>
|
|
</row>
|
|
<row>
|
|
<entry><constant>FILTER_VALIDATE_MAC</constant></entry>
|
|
<entry>"validate_mac_address"</entry>
|
|
<entry>
|
|
<parameter>default</parameter>
|
|
</entry>
|
|
<entry></entry>
|
|
<entry>Valida una dirección MAC.</entry>
|
|
</row>
|
|
<row>
|
|
<entry><constant>FILTER_VALIDATE_REGEXP</constant></entry>
|
|
<entry>"validate_regexp"</entry>
|
|
<entry>
|
|
<parameter>default</parameter>,
|
|
<parameter>regexp</parameter>
|
|
</entry>
|
|
<entry></entry>
|
|
<entry>
|
|
Valida el valor contra <parameter>regexp</parameter>, una
|
|
expresión regular <link linkend="book.pcre">Perl-compatible</link>.
|
|
</entry>
|
|
</row>
|
|
<row>
|
|
<entry><constant>FILTER_VALIDATE_URL</constant></entry>
|
|
<entry>"validate_url"</entry>
|
|
<entry>
|
|
<parameter>default</parameter>
|
|
</entry>
|
|
<entry>
|
|
<constant>FILTER_FLAG_PATH_REQUIRED</constant>,
|
|
<constant>FILTER_FLAG_QUERY_REQUIRED</constant>
|
|
</entry>
|
|
<entry>Valida si su valor es una URL (de acuerdo con <link xlink:href="&url.rfc;2396">&url.rfc;2396</link>), opcionalmente con componentes necesarios. Se ha de tener cuidado ya que un URL válida podría no especificar el protocolo HTTP <literal>http://</literal>, por lo que podrían ser necesarias validaciones posteriores para determinar que el URL utiliza un protocolo esperado, p.ej., <literal>ssh://</literal> o <literal>mailto:</literal>. Nótese que esta función sólo buscará para ser validadas URLs ASCII; los nombres de dominio internacionales (que contienen no-ASCII caracteres) fallarán en la validación.</entry>
|
|
</row>
|
|
</tbody>
|
|
</tgroup>
|
|
</table>
|
|
</para>
|
|
<note>
|
|
<para>
|
|
A partir de PHP 5.4.11, los números +0 y -0 se validan tanto como integer y
|
|
como float (empleando <constant>FILTER_VALIDATE_FLOAT</constant> y
|
|
<constant>FILTER_VALIDATE_INT</constant>). Antes de PHP 5.4.11 solamente
|
|
se validaban como float (empleando <constant>FILTER_VALIDATE_FLOAT</constant>).
|
|
</para>
|
|
<para>
|
|
Cuando <parameter>default</parameter> está establecido a option, se utilizará el valor de <parameter>default</parameter> si el valor no es validado.
|
|
</para>
|
|
</note>
|
|
|
|
<simplesect role="changelog">
|
|
&reftitle.changelog;
|
|
<para>
|
|
<informaltable>
|
|
<tgroup cols="2">
|
|
<thead>
|
|
<row>
|
|
<entry>&Version;</entry>
|
|
<entry>&Description;</entry>
|
|
</row>
|
|
</thead>
|
|
<tbody>
|
|
<row>
|
|
<entry>5.5.0</entry>
|
|
<entry>
|
|
Se añadió <constant>FILTER_VALIDATE_MAC</constant>
|
|
</entry>
|
|
</row>
|
|
</tbody>
|
|
</tgroup>
|
|
</informaltable>
|
|
</para>
|
|
</simplesect>
|
|
|
|
</section>
|
|
<!--}}}-->
|
|
|
|
<!-- Sanitize filters: {{{-->
|
|
<section xml:id="filter.filters.sanitize">
|
|
<title>Filtros de saneamiento</title>
|
|
<para>
|
|
<table>
|
|
<title>Lista de filtros de saneamiento</title>
|
|
<tgroup cols="5">
|
|
<thead>
|
|
<row>
|
|
<entry>ID</entry>
|
|
<entry>Nombre</entry>
|
|
<entry>Banderas</entry>
|
|
<entry>Descripción</entry>
|
|
</row>
|
|
</thead>
|
|
<tbody>
|
|
<row>
|
|
<entry><constant>FILTER_SANITIZE_EMAIL</constant></entry>
|
|
<entry>"email"</entry>
|
|
<entry></entry>
|
|
<entry>
|
|
Elimina todos los caracteres menos letras, dígitos y
|
|
<literal>!#$%&'*+-=?^_`{|}~@.[]</literal>.
|
|
</entry>
|
|
</row>
|
|
<row>
|
|
<entry><constant>FILTER_SANITIZE_ENCODED</constant></entry>
|
|
<entry>"encoded"</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>String URL-encode, opcionalmente elimina o codifica caracteres especiales.</entry>
|
|
</row>
|
|
<row>
|
|
<entry><constant>FILTER_SANITIZE_MAGIC_QUOTES</constant></entry>
|
|
<entry>"magic_quotes"</entry>
|
|
<entry></entry>
|
|
<entry>Aplica <function>addslashes</function>.</entry>
|
|
</row>
|
|
<row>
|
|
<entry><constant>FILTER_SANITIZE_NUMBER_FLOAT</constant></entry>
|
|
<entry>"number_float"</entry>
|
|
<entry>
|
|
<constant>FILTER_FLAG_ALLOW_FRACTION</constant>,
|
|
<constant>FILTER_FLAG_ALLOW_THOUSAND</constant>,
|
|
<constant>FILTER_FLAG_ALLOW_SCIENTIFIC</constant>
|
|
</entry>
|
|
<entry>
|
|
Elimina todos los caracteres a excepción de los dígitos, <literal>+-</literal> y,
|
|
opcionalmente, <literal>.,eE</literal>.
|
|
</entry>
|
|
</row>
|
|
<row>
|
|
<entry><constant>FILTER_SANITIZE_NUMBER_INT</constant></entry>
|
|
<entry>"number_int"</entry>
|
|
<entry></entry>
|
|
<entry>
|
|
Elimina todos los caracteres excepto dígitos y los signos de suma y resta.
|
|
</entry>
|
|
</row>
|
|
<row>
|
|
<entry><constant>FILTER_SANITIZE_SPECIAL_CHARS</constant></entry>
|
|
<entry>"special_chars"</entry>
|
|
<entry>
|
|
<constant>FILTER_FLAG_STRIP_LOW</constant>,
|
|
<constant>FILTER_FLAG_STRIP_HIGH</constant>,
|
|
<constant>FILTER_FLAG_ENCODE_HIGH</constant>
|
|
</entry>
|
|
<entry>
|
|
Escapa caracteres HTML <literal>'"<>&</literal> y caracteres con
|
|
valores ASCII menores que 32, opcionalmente elimina o codifica
|
|
caracteres especiales.
|
|
</entry>
|
|
</row>
|
|
<row>
|
|
<entry><constant>FILTER_SANITIZE_FULL_SPECIAL_CHARS</constant></entry>
|
|
<entry>"full_special_chars"</entry>
|
|
<entry>
|
|
<constant>FILTER_FLAG_NO_ENCODE_QUOTES</constant>,
|
|
</entry>
|
|
<entry>
|
|
Equivalente a llamar a <function>htmlspecialchars</function> con <constant>ENT_QUOTES</constant> establecido. Las comillas de codificación pueden
|
|
ser desactivadas mediante el establecimiento de <constant>FILTER_FLAG_NO_ENCODE_QUOTES</constant>. Al igual que <function>htmlspecialchars</function>,
|
|
este filtro tiene en cuenta el <link linkend="ini.default-charset">default_charset</link> y si en una secuencia de bytes se detecta que
|
|
contiene un carácter no válido en el conjunto de caracteres actual entonces el string completo es rechazado lo que resulta en un string de longitud 0.
|
|
Cuando se utiliza este filtro como un filtro predeterminado, vea la advertiencia de abajo sobre establecer las banderas predeterminadas a 0.
|
|
</entry>
|
|
</row>
|
|
<row>
|
|
<entry><constant>FILTER_SANITIZE_STRING</constant></entry>
|
|
<entry>"string"</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>Elimina etiquetas, opcionalmente elimina o codifica caracteres especiales.</entry>
|
|
</row>
|
|
<row>
|
|
<entry><constant>FILTER_SANITIZE_STRIPPED</constant></entry>
|
|
<entry>"stripped"</entry>
|
|
<entry></entry>
|
|
<entry>Alias del filtro "string".</entry>
|
|
</row>
|
|
<row>
|
|
<entry><constant>FILTER_SANITIZE_URL</constant></entry>
|
|
<entry>"url"</entry>
|
|
<entry></entry>
|
|
<entry>
|
|
Elimina todos los caracteres excepto letras, dígitos y
|
|
<literal>$-_.+!*'(),{}|\\^~[]`<>#%";/?:@&=</literal>.
|
|
</entry>
|
|
</row>
|
|
<row>
|
|
<entry><constant>FILTER_UNSAFE_RAW</constant></entry>
|
|
<entry>"unsafe_raw"</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>
|
|
No hace nada, opcionalmente eliminar o condificar caracteres. Este
|
|
filtro es un alias de <constant>FILTER_DEFAULT</constant>.
|
|
</entry>
|
|
</row>
|
|
</tbody>
|
|
</tgroup>
|
|
</table>
|
|
</para>
|
|
<warning>
|
|
<para>
|
|
Cuando se utiliza uno de estos tres filtros como un filtro predetermindo a través de fichero ini
|
|
o de la configuración del servidor web, las banderas predeterminadas son establecidas a
|
|
<constant>FILTER_FLAG_NO_ENCODE_QUOTES</constant>. Se necesita establecer explícitamente
|
|
filter.default_flags a 0 para tener la codificación de comillas por omisión. Como esto:
|
|
<example>
|
|
<title>Configurar el filtro predeterminado para que actúe como htmlspecialchars</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
filter.default = full_special_chars
|
|
filter.default_flags = 0
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
</warning>
|
|
|
|
<simplesect role="changelog">
|
|
&reftitle.changelog;
|
|
<para>
|
|
<informaltable>
|
|
<tgroup cols="2">
|
|
<thead>
|
|
<row>
|
|
<entry>&Version;</entry>
|
|
<entry>&Description;</entry>
|
|
</row>
|
|
</thead>
|
|
<tbody>
|
|
<row>
|
|
<entry>5.2.11/5.3.1</entry>
|
|
<entry>
|
|
Las barras (<literal>/</literal>) son eliminadas por
|
|
<constant>FILTER_SANITIZE_EMAIL</constant>. Antes se mantenían.
|
|
</entry>
|
|
</row>
|
|
</tbody>
|
|
</tgroup>
|
|
</informaltable>
|
|
</para>
|
|
</simplesect>
|
|
|
|
</section>
|
|
<!--}}}-->
|
|
|
|
<!-- Other filters: {{{-->
|
|
<section xml:id="filter.filters.misc">
|
|
<title>Otros filtros</title>
|
|
<para>
|
|
<table>
|
|
<title>Lista de filtros varios</title>
|
|
<tgroup cols="5">
|
|
<thead>
|
|
<row>
|
|
<entry>ID</entry>
|
|
<entry>Nombre</entry>
|
|
<entry>Opciones</entry>
|
|
<entry>Banderas</entry>
|
|
<entry>Descripción</entry>
|
|
</row>
|
|
</thead>
|
|
<tbody>
|
|
<row>
|
|
<entry><constant>FILTER_CALLBACK</constant></entry>
|
|
<entry>"callback"</entry>
|
|
<entry>Función o método <type>callable</type></entry>
|
|
<entry></entry>
|
|
<entry>Llamadas a funciones definidas por el usuario para filtrar datos.</entry>
|
|
</row>
|
|
</tbody>
|
|
</tgroup>
|
|
</table>
|
|
</para>
|
|
</section>
|
|
<!--}}}-->
|
|
|
|
<!-- Filter flags: {{{-->
|
|
<section xml:id="filter.filters.flags">
|
|
<title>Opciones de filtrado</title>
|
|
|
|
<para>
|
|
<table>
|
|
<title>Lista de opciones de los filtros</title>
|
|
<tgroup cols="3">
|
|
<thead>
|
|
<row>
|
|
<entry>ID</entry>
|
|
<entry>Usado con</entry>
|
|
<entry>Descripción</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>
|
|
Elimina caracteres que tienen un valor numérico <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>
|
|
Elimina caracteres que tienen un valor numérico >127.
|
|
</entry>
|
|
</row>
|
|
<row>
|
|
<entry><constant>FILTER_FLAG_ALLOW_FRACTION</constant></entry>
|
|
<entry>
|
|
<constant>FILTER_SANITIZE_NUMBER_FLOAT</constant>
|
|
</entry>
|
|
<entry>
|
|
Permite usar un punto (<literal>.</literal>) como separador de decimales en los
|
|
números.
|
|
</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>
|
|
Permite usar una coma (<literal>,</literal>) como separador de miles en los
|
|
números.
|
|
</entry>
|
|
</row>
|
|
<row>
|
|
<entry><constant>FILTER_FLAG_ALLOW_SCIENTIFIC</constant></entry>
|
|
<entry>
|
|
<constant>FILTER_SANITIZE_NUMBER_FLOAT</constant>
|
|
</entry>
|
|
<entry>
|
|
Permite usar una <literal>e</literal> o <literal>E</literal> para la notación científica
|
|
de números.
|
|
</entry>
|
|
</row>
|
|
<row>
|
|
<entry><constant>FILTER_FLAG_NO_ENCODE_QUOTES</constant></entry>
|
|
<entry>
|
|
<constant>FILTER_SANITIZE_STRING</constant>
|
|
</entry>
|
|
<entry>
|
|
Si se indica esta opción, las comillas simples (<literal>'</literal>) y las dobles
|
|
(<literal>"</literal>) no se codificarán.
|
|
</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>
|
|
Codifica todos los caracteres con valor numérico <32.
|
|
</entry>
|
|
</row>
|
|
<row>
|
|
<entry><constant>FILTER_FLAG_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>
|
|
Codifica todos los caracteres con valor numérico >127.
|
|
</entry>
|
|
</row>
|
|
<row>
|
|
<entry><constant>FILTER_FLAG_ENCODE_AMP</constant></entry>
|
|
<entry>
|
|
<constant>FILTER_SANITIZE_STRING</constant>,
|
|
<constant>FILTER_SANITIZE_RAW</constant>
|
|
</entry>
|
|
<entry>
|
|
Codifica ampersands (<literal>&</literal>).
|
|
</entry>
|
|
</row>
|
|
<row>
|
|
<entry><constant>FILTER_NULL_ON_FAILURE</constant></entry>
|
|
<entry>
|
|
<constant>FILTER_VALIDATE_BOOLEAN</constant>
|
|
</entry>
|
|
<entry>
|
|
Devuelve &null; para valores boolean que no se reconozcan.
|
|
</entry>
|
|
</row>
|
|
<row>
|
|
<entry><constant>FILTER_FLAG_ALLOW_OCTAL</constant></entry>
|
|
<entry>
|
|
<constant>FILTER_VALIDATE_INT</constant>
|
|
</entry>
|
|
<entry>
|
|
Permite datos de entrada que comiencen por un cero (<literal>0</literal>) como número
|
|
octal. Esto obliga a que los siguientes dígitos sean únicamente
|
|
<literal>0-7</literal>.
|
|
</entry>
|
|
</row>
|
|
<row>
|
|
<entry><constant>FILTER_FLAG_ALLOW_HEX</constant></entry>
|
|
<entry>
|
|
<constant>FILTER_VALIDATE_INT</constant>
|
|
</entry>
|
|
<entry>
|
|
Permite datos de entrada que comiencen por <literal>0x</literal> o <literal>0X</literal>
|
|
como número hexadecimal. Esto obliga a que los siguientes dígitos sean únicamente
|
|
<literal>a-fA-F0-9</literal>.
|
|
</entry>
|
|
</row>
|
|
<row>
|
|
<entry><constant>FILTER_FLAG_IPV4</constant></entry>
|
|
<entry>
|
|
<constant>FILTER_VALIDATE_IP</constant>
|
|
</entry>
|
|
<entry>
|
|
Permite direcciones IP en formato IPv4.
|
|
</entry>
|
|
</row>
|
|
<row>
|
|
<entry><constant>FILTER_FLAG_IPV6</constant></entry>
|
|
<entry>
|
|
<constant>FILTER_VALIDATE_IP</constant>
|
|
</entry>
|
|
<entry>
|
|
Permite direcciones IP en formato IPv6.
|
|
</entry>
|
|
</row>
|
|
<row>
|
|
<entry><constant>FILTER_FLAG_NO_PRIV_RANGE</constant></entry>
|
|
<entry>
|
|
<constant>FILTER_VALIDATE_IP</constant>
|
|
</entry>
|
|
<entry>
|
|
<para>
|
|
Falla si se intenta validar alguna de los siguientes rangos privados de IPv4:
|
|
<literal>10.0.0.0/8</literal>, <literal>172.16.0.0/12</literal> y
|
|
<literal>192.168.0.0/16</literal>.
|
|
</para>
|
|
<para>
|
|
Falla si se intenta validad direcciones IPv6 que empiecen por
|
|
<literal>FD</literal> o <literal>FC</literal>.
|
|
</para>
|
|
</entry>
|
|
</row>
|
|
<row>
|
|
<entry><constant>FILTER_FLAG_NO_RES_RANGE</constant></entry>
|
|
<entry>
|
|
<constant>FILTER_VALIDATE_IP</constant>
|
|
</entry>
|
|
<entry>
|
|
Falla si se intenta validad alguno de los siguientes rangos IPv4 reservados:
|
|
<literal>0.0.0.0/8</literal>, <literal>169.254.0.0/16</literal>,
|
|
<literal>192.0.2.0/24</literal> y <literal>224.0.0.0/4</literal>.
|
|
Este flag no se aplica a direcciones IPv6.
|
|
</entry>
|
|
</row>
|
|
<row>
|
|
<entry><constant>FILTER_FLAG_PATH_REQUIRED</constant></entry>
|
|
<entry>
|
|
<constant>FILTER_VALIDATE_URL</constant>
|
|
</entry>
|
|
<entry>
|
|
Requiere que el <acronym>URL</acronym> contenga parte de la ruta.
|
|
</entry>
|
|
</row>
|
|
<row>
|
|
<entry><constant>FILTER_FLAG_QUERY_REQUIRED</constant></entry>
|
|
<entry>
|
|
<constant>FILTER_VALIDATE_URL</constant>
|
|
</entry>
|
|
<entry>
|
|
Requiere que el <acronym>URL</acronym> contenga un query string.
|
|
</entry>
|
|
</row>
|
|
<row>
|
|
<entry><constant>FILTER_REQUIRE_SCALAR</constant></entry>
|
|
<entry>
|
|
</entry>
|
|
<entry>
|
|
Requiere que el valor sea escalar.
|
|
</entry>
|
|
</row>
|
|
<row>
|
|
<entry><constant>FILTER_REQUIRE_ARRAY</constant></entry>
|
|
<entry>
|
|
</entry>
|
|
<entry>
|
|
Requiere que el valor sea un array.
|
|
</entry>
|
|
</row>
|
|
<row>
|
|
<entry><constant>FILTER_FORCE_ARRAY</constant></entry>
|
|
<entry>
|
|
</entry>
|
|
<entry>
|
|
Si el valor es un escalar, es tratado como un array con el valor escalar
|
|
cómo único elemento.
|
|
</entry>
|
|
</row>
|
|
</tbody>
|
|
</tgroup>
|
|
</table>
|
|
</para>
|
|
</section>
|
|
<!--}}}-->
|
|
</chapter>
|
|
|
|
<!-- 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:"~/.phpdoc/manual.ced"
|
|
sgml-exposed-tags:nil
|
|
sgml-local-catalogs:nil
|
|
sgml-local-ecat-files:nil
|
|
End:
|
|
vim600: syn=xml fen fdm=marker fdl=2 si
|
|
vim: et tw=78 syn=sgml
|
|
vi: ts=1 sw=1
|
|
-->
|