Home
last modified time | relevance | path

Searched refs:filter_var (Results 1 – 25 of 81) sorted by relevance

1234

/PHP-8.0/ext/filter/tests/
H A D018.phpt2 filter_var() and FILTER_VALIDATE_IP
7 var_dump(filter_var("192.168.0.1", FILTER_VALIDATE_IP));
8 var_dump(filter_var("192.168.0.1.1", FILTER_VALIDATE_IP));
9 var_dump(filter_var("::1", FILTER_VALIDATE_IP));
10 var_dump(filter_var("fe00::0", FILTER_VALIDATE_IP));
11 var_dump(filter_var("::123456", FILTER_VALIDATE_IP));
12 var_dump(filter_var("::1::b", FILTER_VALIDATE_IP));
13 var_dump(filter_var("127.0.0.1", FILTER_VALIDATE_IP));
20 var_dump(filter_var("192.0.34.166", FILTER_VALIDATE_IP));
24 var_dump(filter_var("", FILTER_VALIDATE_IP));
[all …]
H A Dfilter_data.phpt2 Simple filter_var() tests
11 $data = "-123"; var_dump(filter_var($data, FILTER_VALIDATE_INT));
12 $data = "0"; var_dump(filter_var($data, FILTER_VALIDATE_INT));
13 $data = "-0"; var_dump(filter_var($data, FILTER_VALIDATE_INT));
14 $data = "+0"; var_dump(filter_var($data, FILTER_VALIDATE_INT));
15 $data = "123"; var_dump(filter_var($data, FILTER_VALIDATE_INT));
16 $data = -123; var_dump(filter_var($data, FILTER_VALIDATE_INT));
17 $data = 0; var_dump(filter_var($data, FILTER_VALIDATE_INT));
18 $data = -0; var_dump(filter_var($data, FILTER_VALIDATE_INT));
20 $data = 123; var_dump(filter_var($data, FILTER_VALIDATE_INT));
[all …]
H A D021.phpt2 filter_var() and FILTER_SANITIZE_NUMBER_*
8 var_dump(filter_var("qwertyu123456dfghj", FILTER_SANITIZE_NUMBER_INT));
9 var_dump(filter_var("asd123123.asd123.23", FILTER_SANITIZE_NUMBER_INT));
10 var_dump(filter_var("123,23", FILTER_SANITIZE_NUMBER_INT));
11 var_dump(filter_var("", FILTER_SANITIZE_NUMBER_INT));
12 var_dump(filter_var("0", FILTER_SANITIZE_NUMBER_INT));
13 var_dump(filter_var("asd123.2asd", FILTER_SANITIZE_NUMBER_INT));
14 var_dump(filter_var("qwertyuiop", FILTER_SANITIZE_NUMBER_INT));
15 var_dump(filter_var("123.4", FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION));
16 var_dump(filter_var("123,4", FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION));
[all …]
H A D013.phpt2 filter_var() and flags
7 var_dump(filter_var(" 234", FILTER_VALIDATE_INT));
8 var_dump(filter_var("234 ", FILTER_VALIDATE_INT));
9 var_dump(filter_var(" 234 ", FILTER_VALIDATE_INT));
10 var_dump(filter_var("0xff", FILTER_VALIDATE_INT, array("flags"=>FILTER_FLAG_ALLOW_HEX)));
11 var_dump(filter_var("0Xff", FILTER_VALIDATE_INT, array("flags"=>FILTER_FLAG_ALLOW_HEX)));
12 var_dump(filter_var("0xFF", FILTER_VALIDATE_INT, array("flags"=>FILTER_FLAG_ALLOW_HEX)));
13 var_dump(filter_var("0XFF", FILTER_VALIDATE_INT, array("flags"=>FILTER_FLAG_ALLOW_HEX)));
14 var_dump(filter_var("07", FILTER_VALIDATE_INT, array("flags"=>FILTER_FLAG_ALLOW_OCTAL)));
38 var_dump(filter_var("0ff", FILTER_VALIDATE_INT));
[all …]
H A D014.phpt2 filter_var() and FILTER_VALIDATE_BOOLEAN
17 var_dump(filter_var("no", FILTER_VALIDATE_BOOLEAN));
18 var_dump(filter_var(NULL, FILTER_VALIDATE_BOOLEAN));
19 var_dump(filter_var($t, FILTER_VALIDATE_BOOLEAN));
21 var_dump(filter_var("yes", FILTER_VALIDATE_BOOLEAN));
24 var_dump(filter_var("off", FILTER_VALIDATE_BOOLEAN));
25 var_dump(filter_var("on", FILTER_VALIDATE_BOOLEAN));
26 var_dump(filter_var("0", FILTER_VALIDATE_BOOLEAN));
27 var_dump(filter_var("1", FILTER_VALIDATE_BOOLEAN));
29 var_dump(filter_var("", FILTER_VALIDATE_BOOLEAN));
[all …]
H A D061.phpt2 filter_var() and FILTER_VALIDATE_BOOL
17 var_dump(filter_var("no", FILTER_VALIDATE_BOOL));
18 var_dump(filter_var(NULL, FILTER_VALIDATE_BOOL));
19 var_dump(filter_var($t, FILTER_VALIDATE_BOOL));
21 var_dump(filter_var("yes", FILTER_VALIDATE_BOOL));
24 var_dump(filter_var("off", FILTER_VALIDATE_BOOL));
25 var_dump(filter_var("on", FILTER_VALIDATE_BOOL));
26 var_dump(filter_var("0", FILTER_VALIDATE_BOOL));
27 var_dump(filter_var("1", FILTER_VALIDATE_BOOL));
29 var_dump(filter_var("", FILTER_VALIDATE_BOOL));
[all …]
H A Dbug47435.phpt7 var_dump(filter_var("FC00::1", FILTER_VALIDATE_IP, FILTER_FLAG_IPV6));
9 var_dump(filter_var("::", FILTER_VALIDATE_IP, FILTER_FLAG_IPV6));
10 var_dump(filter_var("::", FILTER_VALIDATE_IP, FILTER_FLAG_IPV6 | FILTER_FLAG_NO_RES_RANGE));
11 var_dump(filter_var("::1", FILTER_VALIDATE_IP, FILTER_FLAG_IPV6));
12 var_dump(filter_var("::1", FILTER_VALIDATE_IP, FILTER_FLAG_IPV6 | FILTER_FLAG_NO_RES_RANGE));
13 var_dump(filter_var("fe80:5:6::1", FILTER_VALIDATE_IP, FILTER_FLAG_IPV6));
15 var_dump(filter_var("2001:0db8::1", FILTER_VALIDATE_IP, FILTER_FLAG_IPV6));
17 var_dump(filter_var("2001:0010::1", FILTER_VALIDATE_IP, FILTER_FLAG_IPV6));
19 var_dump(filter_var("240b:0010::1", FILTER_VALIDATE_IP, FILTER_FLAG_IPV6));
21 var_dump(filter_var("5f::1", FILTER_VALIDATE_IP, FILTER_FLAG_IPV6));
[all …]
H A Dbug49510.phpt7 var_dump(filter_var(false, FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE));
8 var_dump(filter_var(0, FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE));
9 var_dump(filter_var("0", FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE));
10 var_dump(filter_var("off", FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE));
11 var_dump(filter_var("", FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE));
12 var_dump(filter_var("false", FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE));
13 var_dump(filter_var("no", FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE));
15 var_dump(filter_var(true, FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE));
16 var_dump(filter_var(1, FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE));
17 var_dump(filter_var("1", FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE));
[all …]
H A D028.phpt2 filter_var() and FILTER_SANITIZE_SPECIAL_CHARS
8 var_dump(filter_var("?><!@#$%^&*()}{~Qwertyuilfdsasdfgmnbvcxcvbn", FILTER_SANITIZE_SPECIAL_CHARS));
9 var_dump(filter_var("<data&sons>", FILTER_SANITIZE_SPECIAL_CHARS));
10 var_dump(filter_var("", FILTER_SANITIZE_SPECIAL_CHARS));
12 var_dump(filter_var("?><!@#$%^&*()}{~Qwertyuilfdsasdfgmnbvcxcvbn", FILTER_SANITIZE_SPECIAL_CHARS, F…
13 var_dump(filter_var("<data&sons>", FILTER_SANITIZE_SPECIAL_CHARS, FILTER_FLAG_ENCODE_LOW));
14 var_dump(filter_var("", FILTER_SANITIZE_SPECIAL_CHARS, FILTER_FLAG_ENCODE_LOW));
17 var_dump(filter_var("<data&sons>", FILTER_SANITIZE_SPECIAL_CHARS, FILTER_FLAG_ENCODE_HIGH));
18 var_dump(filter_var("", FILTER_SANITIZE_SPECIAL_CHARS, FILTER_FLAG_ENCODE_HIGH));
20 var_dump(filter_var("кириллица", FILTER_SANITIZE_SPECIAL_CHARS, FILTER_FLAG_ENCODE_HIGH));
[all …]
H A D025.phpt2 filter_var() and FILTER_SANITIZE_STRING
8 var_dump(filter_var("", FILTER_SANITIZE_STRING));
9 var_dump(filter_var("<>", FILTER_SANITIZE_STRING));
10 var_dump(filter_var("<>!@#$%^&*()'\"", FILTER_SANITIZE_STRING, FILTER_FLAG_NO_ENCODE_QUOTES));
11 var_dump(filter_var("<>!@#$%^&*()'\"", FILTER_SANITIZE_STRING, FILTER_FLAG_ENCODE_AMP));
12 var_dump(filter_var("<>`1234567890", FILTER_SANITIZE_STRING));
13 var_dump(filter_var("`123`", FILTER_SANITIZE_STRING));
14 var_dump(filter_var(".", FILTER_SANITIZE_STRING));
H A Dbug53150.phpt7 var_dump(filter_var('127.0.0.1', FILTER_VALIDATE_IP));
8 var_dump(filter_var("::1", FILTER_VALIDATE_IP));
10 var_dump(filter_var('127.0.0.1', FILTER_VALIDATE_IP, FILTER_FLAG_NO_RES_RANGE));
11 var_dump(filter_var('::1', FILTER_VALIDATE_IP, FILTER_FLAG_NO_RES_RANGE));
13 var_dump(filter_var('128.0.0.1', FILTER_VALIDATE_IP));
14 var_dump(filter_var('128.0.0.1', FILTER_VALIDATE_IP, FILTER_FLAG_NO_RES_RANGE));
16 var_dump(filter_var('191.255.0.0', FILTER_VALIDATE_IP));
17 var_dump(filter_var('191.255.0.0', FILTER_VALIDATE_IP, FILTER_FLAG_NO_RES_RANGE));
H A D010.phpt2 filter_var()
10 var_dump(filter_var(array(1,"1","", "-23234", "text", "asdf234asdfgs", array()), FILTER_VALIDATE_IN…
11 var_dump(filter_var(array(1.2,"1.7","", "-23234.123", "text", "asdf234.2asdfgs", array()), FILTER_V…
12 var_dump(filter_var(1, FILTER_SANITIZE_STRING, 1));
13 var_dump(filter_var(1, FILTER_SANITIZE_STRING, 0));
14 var_dump(filter_var(1, FILTER_SANITIZE_STRING, array()));
15 var_dump(filter_var(1, -1, array(123)));
16 var_dump(filter_var(1, 0, array()));
59 Warning: filter_var(): Unknown filter with ID -1 in %s on line %d
62 Warning: filter_var(): Unknown filter with ID 0 in %s on line %d
H A D027.phpt2 filter_var() and FILTER_SANITIZE_ENCODED
8 var_dump(filter_var("?><!@#$%^&*()}{~Qwertyuilfdsasdfgmnbvcxcvbn", FILTER_SANITIZE_ENCODED));
9 var_dump(filter_var("<data&sons>", FILTER_SANITIZE_ENCODED));
10 var_dump(filter_var("", FILTER_SANITIZE_ENCODED));
12 var_dump(filter_var("?><!@#$%^&*()}{~Qwertyuilfdsasdfgmnbvcxcvbn", FILTER_SANITIZE_ENCODED, FILTER_…
13 var_dump(filter_var("<data&sons>", FILTER_SANITIZE_ENCODED, FILTER_FLAG_ENCODE_LOW));
14 var_dump(filter_var("", FILTER_SANITIZE_ENCODED, FILTER_FLAG_ENCODE_LOW));
16 var_dump(filter_var("?><!@#$%^&*()}{~Qwertyuilfdsasdfgmnbvcxcvbn", FILTER_SANITIZE_ENCODED, FILTER_…
17 var_dump(filter_var("<data&sons>", FILTER_SANITIZE_ENCODED, FILTER_FLAG_ENCODE_HIGH));
18 var_dump(filter_var("", FILTER_SANITIZE_ENCODED, FILTER_FLAG_ENCODE_HIGH));
H A D029.phpt2 filter_var() and FILTER_CALLBACK
13 var_dump(filter_var("data", FILTER_CALLBACK, array("options"=>"test")));
15 var_dump(filter_var("", FILTER_CALLBACK, array("options"=>"test")));
18 filter_var("qwe", FILTER_CALLBACK, array("options"=>"no such func"));
24 filter_var("qwe", FILTER_CALLBACK, array("options"=>""));
30 filter_var("qwe", FILTER_CALLBACK);
52 var_dump(filter_var("", FILTER_CALLBACK, array("options"=>"test1")));
61 var_dump(filter_var("", FILTER_CALLBACK, array("options"=>"test2")));
80 filter_var(): Option must be a valid callback
81 filter_var(): Option must be a valid callback
[all …]
H A D017.phpt2 filter_var() and FILTER_VALIDATE_REGEXP
8 var_dump(filter_var("data", FILTER_VALIDATE_REGEXP, array("options"=>array("regexp"=>'/.*/'))));
9 var_dump(filter_var("data", FILTER_VALIDATE_REGEXP, array("options"=>array("regexp"=>'/^b(.*)/'))));
10 var_dump(filter_var("data", FILTER_VALIDATE_REGEXP, array("options"=>array("regexp"=>'/^d(.*)/'))));
11 var_dump(filter_var("data", FILTER_VALIDATE_REGEXP, array("options"=>array("regexp"=>'/blah/'))));
12 var_dump(filter_var("data", FILTER_VALIDATE_REGEXP, array("options"=>array("regexp"=>'/\[/'))));
14 filter_var("data", FILTER_VALIDATE_REGEXP);
27 filter_var(): "regexp" option is missing
H A D019.phpt2 filter_var() & FILTER_VALIDATE_IP and weird data
8 var_dump(filter_var("....", FILTER_VALIDATE_IP));
9 var_dump(filter_var("...", FILTER_VALIDATE_IP));
10 var_dump(filter_var("..", FILTER_VALIDATE_IP));
11 var_dump(filter_var(".", FILTER_VALIDATE_IP));
12 var_dump(filter_var("1.1.1.1", FILTER_VALIDATE_IP));
H A D026.phpt2 filter_var() and FILTER_SANITIZE_STRIPPED
8 var_dump(filter_var("<p>Let me <font color=\"#000000\">see</font> you <br /><b>Stripped</b> down to…
9 var_dump(filter_var("!@#$%^&*()><<>+_\"'<br><p /><li />", FILTER_SANITIZE_STRIPPED));
10 var_dump(filter_var("", FILTER_SANITIZE_STRIPPED));
12 var_dump(filter_var("<p>Let me <font color=\"#000000\">see</font> you <br /><b>Stripped</b> down to…
13 var_dump(filter_var("!@#$%^&*()><<>+_\"'<br><p /><li />", FILTER_SANITIZE_STRIPPED, FILTER_FLAG_STR…
14 var_dump(filter_var("", FILTER_SANITIZE_STRIPPED, FILTER_FLAG_STRIP_LOW));
16 var_dump(filter_var("<p>Let me <font color=\"#000000\">see</font> you <br /><b>Stripped</b> down to…
17 var_dump(filter_var("!@#$%^&*()><<>+_\"'<br><p /><li />", FILTER_SANITIZE_STRIPPED, FILTER_FLAG_STR…
18 var_dump(filter_var("", FILTER_SANITIZE_STRIPPED, FILTER_FLAG_STRIP_HIGH));
H A D022.phpt2 filter_var() and FILTER_SANITIZE_EMAIL
8 var_dump(filter_var("a@b.c", FILTER_SANITIZE_EMAIL));
9 var_dump(filter_var("a[!@#$%^&*()@a@#$%^&*(.com@#$%^&*(", FILTER_SANITIZE_EMAIL));
10 var_dump(filter_var("white space here \ \ \" some more", FILTER_SANITIZE_EMAIL));
11 var_dump(filter_var("", FILTER_SANITIZE_EMAIL));
12 var_dump(filter_var("123456789000000", FILTER_SANITIZE_EMAIL));
H A D059.phpt2 filter_var() and FILTER_SANITIZE_ADD_SLASHES
8 var_dump(filter_var("test'asd'asd'' asd\'\"asdfasdf", FILTER_SANITIZE_ADD_SLASHES));
9 var_dump(filter_var("'", FILTER_SANITIZE_ADD_SLASHES));
10 var_dump(filter_var("", FILTER_SANITIZE_ADD_SLASHES));
11 var_dump(filter_var(-1, FILTER_SANITIZE_ADD_SLASHES));
H A D023.phpt2 filter_var() and FILTER_UNSAFE_RAW
8 var_dump(filter_var("}\"<p>test para</p>", FILTER_UNSAFE_RAW, FILTER_FLAG_ENCODE_AMP));
9 var_dump(filter_var("a[!@#<b>$%^&*()@a@#$%^&*(.<br>com@#$%^&*(", FILTER_UNSAFE_RAW, FILTER_FLAG_ENC…
10 var_dump(filter_var("white space here \ \ \" some more", FILTER_UNSAFE_RAW, FILTER_FLAG_ENCODE_AMP)…
11 var_dump(filter_var("", FILTER_UNSAFE_RAW, FILTER_FLAG_ENCODE_AMP));
12 var_dump(filter_var(" 123456789000000 <qwertyuiop> ", FILTER_UNSAFE_RAW, FILTER_F…
H A Dbug80584.phpt2 Bug #80584: "0x" and "0X" are considered valid hex numbers by filter_var()
9 var_dump(filter_var('0x', FILTER_VALIDATE_INT, FILTER_FLAG_ALLOW_HEX));
10 var_dump(filter_var('0X', FILTER_VALIDATE_INT, FILTER_FLAG_ALLOW_HEX));
11 var_dump(filter_var('', FILTER_VALIDATE_INT, FILTER_FLAG_ALLOW_HEX));
12 var_dump(filter_var('0', FILTER_VALIDATE_INT, FILTER_FLAG_ALLOW_HEX));
H A D038.phpt9 $res = filter_var($var, FILTER_VALIDATE_INT, array('flags'=>FILTER_FLAG_ALLOW_OCTAL));
13 $res = filter_var($var, FILTER_VALIDATE_INT, array('flags'=>FILTER_FLAG_ALLOW_OCTAL));
17 $res = filter_var($var, FILTER_VALIDATE_INT, array('flags'=>FILTER_FLAG_ALLOW_OCTAL|FILTER_FORCE_AR…
23 $res = filter_var($var, FILTER_VALIDATE_INT, array('flags'=>FILTER_FLAG_ALLOW_OCTAL|FILTER_REQUIRE_…
27 $res = filter_var($var, FILTER_VALIDATE_INT, array('flags'=>FILTER_FLAG_ALLOW_OCTAL|FILTER_REQUIRE_…
31 $res = filter_var($var, FILTER_VALIDATE_INT, array('flags'=>FILTER_FLAG_ALLOW_OCTAL|FILTER_FORCE_AR…
35 $res = filter_var($var, FILTER_VALIDATE_INT, array('flags'=>FILTER_FLAG_ALLOW_OCTAL|FILTER_FORCE_AR…
H A D056.phpt2 filter_var() and FILTER_VALIDATE_DOMAIN
28 var_dump(filter_var($value, FILTER_VALIDATE_DOMAIN, FILTER_FLAG_HOSTNAME));
31 var_dump(filter_var('_example.com', FILTER_VALIDATE_DOMAIN));
32 var_dump(filter_var('_example.com', FILTER_VALIDATE_DOMAIN, FILTER_FLAG_HOSTNAME));
33 var_dump(filter_var('test_.example.com', FILTER_VALIDATE_DOMAIN));
34 var_dump(filter_var('test_.example.com', FILTER_VALIDATE_DOMAIN, FILTER_FLAG_HOSTNAME));
35 var_dump(filter_var('te_st.example.com', FILTER_VALIDATE_DOMAIN));
36 var_dump(filter_var('te_st.example.com', FILTER_VALIDATE_DOMAIN, FILTER_FLAG_HOSTNAME));
37 var_dump(filter_var('test._example.com', FILTER_VALIDATE_DOMAIN));
38 var_dump(filter_var('test._example.com', FILTER_VALIDATE_DOMAIN, FILTER_FLAG_HOSTNAME));
H A D024.phpt2 filter_var() and FILTER_SANITIZE_ENCODED
8 var_dump(filter_var("\"<br>blah</ph>", FILTER_SANITIZE_ENCODED));
9 var_dump(filter_var("", FILTER_SANITIZE_ENCODED));
10 var_dump(filter_var(" text here ", FILTER_SANITIZE_ENCODED));
11 var_dump(filter_var("!@#$%^&*()QWERTYUIOP{ASDFGHJKL:\"ZXCVBNM<>?", FILTER_SANITIZE_ENCODED));
H A Dbug69203.phpt7 var_dump(filter_var("\x7f", FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_HIGH));
8 var_dump(filter_var("\x7f", FILTER_UNSAFE_RAW, FILTER_FLAG_STRIP_HIGH));
9 var_dump(filter_var("\x7f", FILTER_SANITIZE_ENCODED, FILTER_FLAG_STRIP_HIGH));
10 var_dump(filter_var("\x7f", FILTER_SANITIZE_SPECIAL_CHARS, FILTER_FLAG_STRIP_HIGH));

Completed in 109 milliseconds

1234