Don't leave behind temporary file in bug70362.phpt

This commit is contained in:
Nikita Popov 2020-09-07 16:15:44 +02:00
parent 4ebc04ca9d
commit 2a334f1655

View File

@ -4,11 +4,16 @@ Bug #70362 (Can't copy() large 'data://' with open_basedir)
open_basedir=.
--FILE--
<?php
$temp = tempnam(__DIR__, 'test');
$file = __DIR__ . '/bug70362.txt';
$data = str_repeat('0', 4096);
$data = 'data://plain/text;base64,' . base64_encode($data);
var_dump(copy($data, $temp));
echo file_get_contents($temp);
var_dump(copy($data, $file));
echo file_get_contents($file);
?>
--CLEAN--
<?php
$file = __DIR__ . '/bug70362.txt';
@unlink($file);
?>
--EXPECT--
bool(true)