File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -30,11 +30,11 @@ public function loadXmlString($html)
30
30
// - help link in footer not terminated
31
31
// - selected branch/tag in CVS "sticky tag" dropdown has not attribute value
32
32
// - self closing elements with no trailing slash
33
- // - excessive form close tags
33
+ // - remove navheader because of its often incomplete form tags
34
34
$ html = str_replace ('Help</strong></td> ' , 'Help</a></strong></td> ' , $ html );
35
35
$ html = str_replace ('selected> ' , 'selected="selected"> ' , $ html );
36
36
$ html = preg_replace ('#<((?:input|br|hr|img)[^\/\>]*)># ' , '<$1 /> ' , $ html );
37
- $ html = preg_replace ('#(</table>\s*)</form>\s*(< /div>)# ' , ' $1$2 ' , $ html );
37
+ $ html = preg_replace ('#\<div class\=\"vc_navheader\"\>.*?\<\ /div\>#s ' , ' ' , $ html );
38
38
39
39
// replace named HTML entities with their UTF-8 value
40
40
$ html = str_replace (array_values ($ this ->entities ), array_keys ($ this ->entities ), $ html );
Original file line number Diff line number Diff line change @@ -60,4 +60,13 @@ public function testLoadInvalidMarkupSelectedAttributeNoValue()
60
60
61
61
$ this ->assertEquals ('selected ' , (string )$ xml ['selected ' ]);
62
62
}
63
+
64
+ public function testLoadRemovedNavHeader ()
65
+ {
66
+ $ str = '<body><div class="vc_navheader"> invalid <asd> </okay> </div> </body> ' ;
67
+ $ xml = $ this ->loader ->loadXmlString ($ str );
68
+
69
+ $ this ->assertFalse (isset ($ xml ->div ));
70
+ $ this ->assertEquals (0 , count ($ xml ));
71
+ }
63
72
}
You can’t perform that action at this time.
0 commit comments