Skip to content

Commit 2a334f1

Browse files
committed
Don't leave behind temporary file in bug70362.phpt
1 parent 4ebc04c commit 2a334f1

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

ext/standard/tests/streams/bug70362.phpt

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,16 @@ Bug #70362 (Can't copy() large 'data://' with open_basedir)
44
open_basedir=.
55
--FILE--
66
<?php
7-
$temp = tempnam(__DIR__, 'test');
7+
$file = __DIR__ . '/bug70362.txt';
88
$data = str_repeat('0', 4096);
99
$data = 'data://plain/text;base64,' . base64_encode($data);
10-
var_dump(copy($data, $temp));
11-
echo file_get_contents($temp);
10+
var_dump(copy($data, $file));
11+
echo file_get_contents($file);
12+
?>
13+
--CLEAN--
14+
<?php
15+
$file = __DIR__ . '/bug70362.txt';
16+
@unlink($file);
1217
?>
1318
--EXPECT--
1419
bool(true)

0 commit comments

Comments
 (0)