File tree Expand file tree Collapse file tree 2 files changed +37
-0
lines changed Expand file tree Collapse file tree 2 files changed +37
-0
lines changed Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ PHP NEWS
30
30
. Fix manually calling __construct() on DOM classes. (nielsdos)
31
31
. Fixed bug GH-11830 (ParentNode methods should perform their checks
32
32
upfront). (nielsdos)
33
+ . Fix viable next sibling search for replaceWith. (nielsdos)
33
34
34
35
- Core:
35
36
. Fixed oss-fuzz #60741 (Leak in open_basedir). (ilutov)
Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ replaceWith() with a non-viable next sibling
3
+ --EXTENSIONS--
4
+ dom
5
+ --FILE--
6
+ <?php
7
+ $ doc = new DOMDocument ;
8
+ $ doc ->loadXML (<<<XML
9
+ <?xml version="1.0"?>
10
+ <container>
11
+ <child>
12
+ <alone/>
13
+ </child>
14
+ </container>
15
+ XML );
16
+
17
+ $ container = $ doc ->documentElement ;
18
+ $ child = $ container ->firstElementChild ;
19
+ $ alone = $ child ->firstElementChild ;
20
+
21
+ $ child ->after ($ alone );
22
+ echo $ doc ->saveXML ();
23
+ $ child ->replaceWith ($ alone );
24
+ echo $ doc ->saveXML ();
25
+ ?>
26
+ --EXPECT--
27
+ <? xml version="1.0 "?>
28
+ <container>
29
+ <child>
30
+
31
+ </child><alone/>
32
+ </container>
33
+ <? xml version="1.0 "?>
34
+ <container>
35
+ <alone/>
36
+ </container>
You can’t perform that action at this time.
0 commit comments