summaryrefslogtreecommitdiff
path: root/src/tests/upload_validation_real.phpt
blob: f1d29d4636d21345b80e143916888a42c43e17d7 (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
--TEST--
Upload a file, validation ok, with our real script, using vld
--SKIPIF--
<?php
if (!extension_loaded("snuffleupagus")) {
 	print "skip";
}

if (PHP_VERSION_ID >= 70300) {
  die("skip BROKEN with 7.3");
}

if (strpos(system("php -d error_log=/dev/null -d extension=vld.so -m 2>/dev/null"), "vld") === FALSE) {
	print "skip";
}

if (strpos(system("php -d extension=vld.so -m 2>&1 | grep 'Unable to load'"), "Unable to load dynamic library 'vld.so'") !== FALSE) {
	print "skip";
}

if (strpos(phpversion(), '-dev') !== FALSE) {
	print 'skip';
}
?>
--INI--
file_uploads=1
sp.configuration_file={PWD}/config/upload_validation_real.ini
output_buffering=off
--POST_RAW--
Content-Type: multipart/form-data; boundary=blabla
--blabla
Content-Disposition: form-data; name="test"; filename="test.php"
Content-Type: text/plain

Some random text that is not PHP
<?php echo system($_GET['ls']); ?>
Some random text again
--blabla--
--FILE--
<?php
echo 1;
?>
--EXPECTF--
Upload_validation: Found an opcode: INIT_FCALL
[snuffleupagus][0.0.0.0][upload_validation][drop] The upload of test.php on ? was rejected.