📄 filter.txt
字号:
* IPV6: Allows IPv6 addresses. * NO_RES_RANGE: Disallows addresses in reversed ranges (IPv4 only) * NO_PRIV_RANGE: Disallows addresses in private ranges (IPv4 only)================ ========== =========== ==================================================Sanitizing Filters==================These filters remove data, or change data depending on the filter, and theset rules for this specific filter. Instead of taking an *options* array, theyuse this parameter for flags for the specific filter.The constants should be prepended by `FILTER_SANITIZE_` when used with php. ============= ================ =========== =====================================================Name Constant Return Type Description ============= ================ =========== =====================================================string STRING string Returns the input variable as a string after it has been stripped of XML/HTML tags and other evil things that can cause XSS problems. $filter_options - an bitmask that supports the following flags: * NO_ENCODE_QUOTES: Prevents single and double quotes from being encoded as numerical HTML entities. * STRIP_LOW: excludes all characters < 0x20 from the allowed character list * STRIP_HIGH: excludes all characters >= 0x80 from the allowed character list * ENCODE_LOW: allows characters < 0x20 but encodes them as numerical HTML entities * ENCODE_HIGH: allows characters >= 0x80 but encodes them as numerical HTML entities * ENCODE_AMP: encodes & as & The flags STRIP_LOW and ENCODE_LOW are mutual exclusive, and so are STRIP_HIGH and ENCODE_HIGH. In the case they clash, the characters will be stripped.stripped STRIPPED string Alias for 'string'.encoded ENCODED string Encodes all characters outside the range "a-zA-Z0-9-._" as URL encoded values. $filter_options - an bitmask that supports the following flags: * STRIP_LOW: excludes all characters < 0x20 from the allowed character list * STRIP_HIGH: excludes all characters >= 0x80 from the allowed character list * ENCODE_LOW: allows characters < 0x20 but encodes them as numerical HTML entities * ENCODE_HIGH: allows characters >= 0x80 but encodes them as numerical HTML entitiesspecial_chars SPECIAL_CHARS string Encodes the 'special' characters ' " < > &, \0 and everything below 0x20 as numerical HTML entities. $filter_options - an bitmask that supports the following flags: * STRIP_LOW: excludes all characters < 0x20 from the allowed character list. If this is not set, then those characters are encoded as numerical HTML entities * STRIP_HIGH: excludes all characters >= 0x80 from the allowed character list * ENCODE_HIGH: allows characters >= 0x80 but encodes them as numerical HTML entitiesunsafe_raw UNSAFE_RAW string Returns the input variable as a string without XML/HTML being stripped from the input value. $filter_options - an bitmask that supports the following flags: * STRIP_LOW: excludes all characters < 0x20 from the allowed character list * STRIP_HIGH: excludes all characters >= 0x80 from the allowed character list * ENCODE_LOW: allows characters < 0x20 but encodes them as numerical HTML entities * ENCODE_HIGH: allows characters >= 0x80 but encodes them as numerical HTML entities * ENCODE_AMP: encodes & as & The flags STRIP_LOW and ENCODE_LOW are mutual exclusive, and so are STRIP_HIGH and ENCODE_HIGH. In the case they clash, the characters will be stripped.email EMAIL string Removes all characters that can not be part of a correctly formed e-mail address (exception are comments in the email address) (a-z A-Z 0-9 " ! # $ % & ' * + - / = ? ^ _ ` { | } ~ @ . [ ]). This filter does `not` validate if the e-mail address has the correct format, use the validate_email filter for that. url URL string Removes all characters that can not be part of a correctly formed URI. (a-z A-Z 0-9 $ - _ . + ! * ' ( ) , { } | \ ^ ~ [ ] ` < > # % " ; / ? : @ & =) This filter does `not` validate if a URI has the correct format, use the validate_url filter for that. number_int NUMBER_INT int Removes all characters that are [^0-9+-].number_float NUMBER_FLOAT float Removes all characters that are [^0-9+-]. $filter_options - an bitmask that supports the following flags: * ALLOW_FRACTION: adds "." to the characters that are not stripped. * ALLOW_THOUSAND: adds "," to the characters that are not stripped. * ALLOW_SCIENTIFIC: adds "eE" to the characters that are not stripped.magic_quotes MAGIC_QUOTES string BC filter for people who like magic quotes.============= ================ =========== =====================================================Callback Filter===============This filter will callback to the specified callback function as specified withthe *filter_options* parameter. All variants of callback functions aresupported:* function with *'functionname'** static method with *array('classname', 'methodname')** dynamic method with *array(&$this, 'methodname')*The constants should be prepended by `FILTER_` when used with php.============= =========== =========== =====================================================Name Constant Return Type Description ============= =========== =========== =====================================================callback CALLBACK mixed Calls the callback function/method with the input variable's value by reference which can do filtering and modifying of the input value. If the callback function returns "false" then the input value is supposed to be incorrect and the returned value will be 'false' (and an E_NOTICE will be raised).============= =========== =========== =====================================================The callback function's prototype is:boolean callback(&$value, $characterset); With *$value* being a reference to the input variable and *$characterset* containing the same value as this parameter's value in the call to *input_get()* or *input_get_array()*. If the *$characterset* parameter was not passed, it defaults to *'null'*.Version: $Id: filter.txt,v 1.5 2006/05/24 11:51:55 pajoye Exp $.. vim: et syn=rst tw=78
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -