1
0
mirror of https://github.com/php/php-src.git synced 2026-04-02 21:52:36 +02:00
Files
archived-php-src/Zend/tests/gh11138.phpt
Ilija Tovilo 8bf2d587d7 Propagate STREAM_DISABLE_OPEN_BASEDIR src flag to php_stream_stat_path_ex
Otherwise we can get open_basedir warnings from the stat call while still
performing the actual copy.

Fixes GH-11138
Closes GH-11156
2023-04-30 13:36:15 +02:00

29 lines
546 B
PHP

--TEST--
move_uploaded_file() emits open_basedir warning for source file
--POST_RAW--
Content-type: multipart/form-data, boundary=AaB03x
--AaB03x
content-disposition: form-data; name="file"; filename="file.txt"
Content-Type: text/plain
foo
--AaB03x--
--FILE--
<?php
ini_set('open_basedir', __DIR__);
$destination = __DIR__ . '/gh11138.tmp';
var_dump(move_uploaded_file($_FILES['file']['tmp_name'], $destination));
echo file_get_contents($destination), "\n";
?>
--CLEAN--
<?php
@unlink(__DIR__ . '/gh11138.tmp');
?>
--EXPECT--
bool(true)
foo