mirror of
https://github.com/php/php-src.git
synced 2024-09-21 18:07:23 +00:00
Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3: Fix #70362: Can't copy() large 'data://' with open_basedir
This commit is contained in:
commit
993b19ae69
3
NEWS
3
NEWS
@ -25,6 +25,9 @@ PHP NEWS
|
||||
. Fixed bug #69804 ()::getStaticPropertyValue() throws on protected props).
|
||||
(cmb, Nikita)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #70362 (Can't copy() large 'data://' with open_basedir). (cmb)
|
||||
|
||||
?? ??? 2020, PHP 7.4.8
|
||||
|
||||
- Core:
|
||||
|
@ -1662,7 +1662,7 @@ PHP_FUNCTION(copy)
|
||||
Z_PARAM_RESOURCE_EX(zcontext, 1, 0)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
|
||||
if (php_check_open_basedir(source)) {
|
||||
if (php_stream_locate_url_wrapper(source, NULL, 0) == &php_plain_files_wrapper && php_check_open_basedir(source)) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
|
15
ext/standard/tests/streams/bug70362.phpt
Normal file
15
ext/standard/tests/streams/bug70362.phpt
Normal file
@ -0,0 +1,15 @@
|
||||
--TEST--
|
||||
Bug #70362 (Can't copy() large 'data://' with open_basedir)
|
||||
--INI--
|
||||
open_basedir=.
|
||||
--FILE--
|
||||
<?php
|
||||
$temp = tempnam(__DIR__, 'test');
|
||||
$data = str_repeat('0', 4096);
|
||||
$data = 'data://plain/text;base64,' . base64_encode($data);
|
||||
var_dump(copy($data, $temp));
|
||||
echo file_get_contents($temp);
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(true)
|
||||
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
Loading…
Reference in New Issue
Block a user