Annotation of embedaddon/php/ext/standard/tests/general_functions/import_request.phpt, revision 1.1.1.2
1.1 misho 1: --TEST--
2: import_request_variables() tests
1.1.1.2 ! misho 3: --SKIPIF--
! 4: <?php if(PHP_VERSION_ID >= 50399){ die('skip not needed anymore without register_globals'); } ?>
1.1 misho 5: --GET--
6: a=1&b=heh&c=3&d[]=5&GLOBALS=test&1=hm
7: --POST--
8: ap=25&bp=test&cp=blah3&dp[]=ar
9: --FILE--
10: <?php
11:
12: var_dump(import_request_variables());
13: var_dump(import_request_variables(""));
14: var_dump(import_request_variables("", ""));
15:
16: var_dump(import_request_variables("g", ""));
17: var_dump($a, $b, $c, $ap);
18:
19: var_dump(import_request_variables("g", "g_"));
20: var_dump($g_a, $g_b, $g_c, $g_ap, $g_1);
21:
22: var_dump(import_request_variables("GP", "i_"));
23: var_dump($i_a, $i_b, $i_c, $i_ap, $i_bp, $i_cp, $i_dp);
24:
25: var_dump(import_request_variables("gGg", "r_"));
26: var_dump($r_a, $r_b, $r_c, $r_ap);
27:
28: echo "Done\n";
29: ?>
30: --EXPECTF--
31: Warning: import_request_variables() expects at least 1 parameter, 0 given in %s on line %d
32: NULL
33: bool(false)
34:
35: Notice: import_request_variables(): No prefix specified - possible security hazard in %s on line %d
36: bool(false)
37:
38: Notice: import_request_variables(): No prefix specified - possible security hazard in %s on line %d
39:
40: Warning: import_request_variables(): Attempted GLOBALS variable overwrite in %s on line %d
41:
42: Warning: import_request_variables(): Numeric key detected - possible security hazard in %s on line %d
43: bool(true)
44:
45: Notice: Undefined variable: ap in %s on line %d
46: string(1) "1"
47: string(3) "heh"
48: string(1) "3"
49: NULL
50: bool(true)
51:
52: Notice: Undefined variable: g_ap in %s on line %d
53: string(1) "1"
54: string(3) "heh"
55: string(1) "3"
56: NULL
57: string(2) "hm"
58: bool(true)
59: string(1) "1"
60: string(3) "heh"
61: string(1) "3"
62: string(2) "25"
63: string(4) "test"
64: string(5) "blah3"
65: array(1) {
66: [0]=>
67: string(2) "ar"
68: }
69: bool(true)
70:
71: Notice: Undefined variable: r_ap in %s on line %d
72: string(1) "1"
73: string(3) "heh"
74: string(1) "3"
75: NULL
76: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>