blob: e588bec767a53721e19ea84426c0e2c3d1faaf27 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
|
--TEST--
Bug #46313 (Magic quotes broke $_FILES)
--SKIPIF--
<?php if(substr(PHP_OS, 0, 3) != "WIN") die("skip Windows-only test"); ?>
--INI--
magic_quotes_gpc=1
file_uploads=1
register_globals=1
--POST_RAW--
Content-Type: multipart/form-data; boundary=---------------------------20896060251896012921717172737
-----------------------------20896060251896012921717172737
Content-Disposition: form-data; name="o1'file"; filename="o1'file.png"
Content-Type: text/plain-file1
1
-----------------------------20896060251896012921717172737
Content-Disposition: form-data; name="o2'file"; filename="o2'file2.txt"
Content-Type: text/plain-file2
2
-----------------------------20896060251896012921717172737--
--FILE--
<?php
var_dump($_FILES);
var_dump($GLOBALS["o1\'file_name"]);
var_dump($GLOBALS["o1\'file_name"] === $_FILES["o1\'file"]["name"]);
var_dump($GLOBALS["o1\'file"]);
var_dump($GLOBALS["o1\'file"] === $_FILES["o1\'file"]["tmp_name"]);
?>
--EXPECTF--
array(2) {
["o1\'file"]=>
array(5) {
["name"]=>
string(12) "o1"
["type"]=>
string(16) "text/plain-file1"
["tmp_name"]=>
string(14) "%s"
["error"]=>
int(0)
["size"]=>
int(1)
}
["o2\'file"]=>
array(5) {
["name"]=>
string(13) "o2"
["type"]=>
string(16) "text/plain-file2"
["tmp_name"]=>
string(14) "%s"
["error"]=>
int(0)
["size"]=>
int(1)
}
}
string(12) "o1"
bool(true)
string(%d) "%s"
bool(true)
Warning: Directive 'register_globals' is deprecated in PHP 5.3 and greater in Unknown on line 0
Warning: Directive 'magic_quotes_gpc' is deprecated in PHP 5.3 and greater in Unknown on line 0
--TEST--
Bug #46313 (Magic quotes broke $_FILES)
--SKIPIF--
<?php if(substr(PHP_OS, 0, 3) != "WIN") die("skip Windows-only test"); ?>
--INI--
magic_quotes_gpc=1
file_uploads=1
--POST_RAW--
Content-Type: multipart/form-data; boundary=---------------------------20896060251896012921717172737
-----------------------------20896060251896012921717172737
Content-Disposition: form-data; name="o1'file"; filename="o1'file.png"
Content-Type: text/plain-file1
1
-----------------------------20896060251896012921717172737
Content-Disposition: form-data; name="o2'file"; filename="o2'file2.txt"
Content-Type: text/plain-file2
2
-----------------------------20896060251896012921717172737--
--FILE--
<?php
var_dump($_FILES);
var_dump($GLOBALS["o1\'file_name"]);
var_dump($GLOBALS["o1\'file_name"] === $_FILES["o1\'file"]["name"]);
var_dump($GLOBALS["o1\'file"]);
var_dump($GLOBALS["o1\'file"] === $_FILES["o1\'file"]["tmp_name"]);
?>
--EXPECTF--
array(2) {
["o1\'file"]=>
array(5) {
["name"]=>
string(12) "o1"
["type"]=>
string(16) "text/plain-file1"
["tmp_name"]=>
string(14) "%s"
["error"]=>
int(0)
["size"]=>
int(1)
}
["o2\'file"]=>
array(5) {
["name"]=>
string(13) "o2"
["type"]=>
string(16) "text/plain-file2"
["tmp_name"]=>
string(14) "%s"
["error"]=>
int(0)
["size"]=>
int(1)
}
}
string(12) "o1"
bool(true)
string(%d) "%s"
bool(true)
|