Skip to content

Commit 66b626f

Browse files
committed
Merge branch 'PHP-7.4'
* PHP-7.4: Fix test case
2 parents ce4d80a + 2704ee6 commit 66b626f

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

ext/xmlwriter/tests/bug79029.phpt

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,31 @@
11
--TEST--
22
#79029 (Use After Free's in XMLReader / XMLWriter)
33
--SKIPIF--
4-
<?php if (!extension_loaded("xmlwriter")) print "skip"; ?>
4+
<?php
5+
if (!extension_loaded("xmlwriter")) print "skip xmlwriter extension not available";
6+
if (!extension_loaded("xmlreader")) print "skip xmlreader extension not available";
7+
?>
58
--FILE--
69
<?php
710
$x = array( new XMLWriter() );
8-
$x[0]->openUri("bug79029.txt");
11+
$x[0]->openUri("bug79029_1.txt");
912
$x[0]->startComment();
10-
@unlink("bug79029.txt");
1113

1214
$x = new XMLWriter();
13-
$x->openUri("bug79029.txt");
15+
$x->openUri("bug79029_2.txt");
1416
fclose(@end(get_resources()));
15-
@unlink("bug79029.txt");
1617

17-
file_put_contents("bug79029.txt", "a");
18+
file_put_contents("bug79029_3.txt", "a");
1819
$x = new XMLReader();
19-
$x->open("bug79029.txt");
20+
$x->open("bug79029_3.txt");
2021
fclose(@end(get_resources()));
21-
@unlink("bug79029.txt");
2222
?>
2323
okey
2424
--CLEAN--
2525
<?php
26-
@unlink("bug79029.txt");
26+
@unlink("bug79029_1.txt");
27+
@unlink("bug79029_2.txt");
28+
@unlink("bug79029_3.txt");
2729
?>
2830
--EXPECTF--
2931
Warning: fclose(): %d is not a valid stream resource in %sbug79029.php on line %d

0 commit comments

Comments
 (0)