Skip to content

Commit

Permalink
Don't leave behind temporary file in bug70362.phpt
Browse files Browse the repository at this point in the history
  • Loading branch information
nikic committed Sep 7, 2020
1 parent 4ebc04c commit 2a334f1
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions ext/standard/tests/streams/bug70362.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 2a334f1

Please sign in to comment.