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 @@ -33,11 +33,11 @@ public function loadXmlString($html)
33
33
// - help link in footer not terminated
34
34
// - selected branch/tag in CVS "sticky tag" dropdown has not attribute value
35
35
// - self closing elements with no trailing slash
36
- // - excessive form close tags
36
+ // - remove navheader because of its often incomplete form tags
37
37
$ html = str_replace ('Help</strong></td> ' , 'Help</a></strong></td> ' , $ html );
38
38
$ html = str_replace ('selected> ' , 'selected="selected"> ' , $ html );
39
39
$ html = preg_replace ('#<((?:input|br|hr|img)[^\/\>]*)># ' , '<$1 /> ' , $ html );
40
- $ html = preg_replace ('#(</table>\s*)</form>\s*(< /div>)# ' , ' $1$2 ' , $ html );
40
+ $ html = preg_replace ('#\<div class\=\"vc_navheader\"\>.*?\<\ /div\>#s ' , ' ' , $ html );
41
41
42
42
// replace named HTML entities with their UTF-8 value
43
43
$ html = str_replace (array_values ($ this ->entities ), array_keys ($ this ->entities ), $ html );
Original file line number Diff line number Diff line change @@ -69,4 +69,13 @@ public function testLoadInvalidMarkupSelectedAttributeNoValue()
69
69
70
70
$ this ->assertEquals ('selected ' , (string )$ xml ['selected ' ]);
71
71
}
72
+
73
+ public function testLoadRemovedNavHeader ()
74
+ {
75
+ $ str = '<body><div class="vc_navheader"> invalid <asd> </okay> </div> </body> ' ;
76
+ $ xml = $ this ->loader ->loadXmlString ($ str );
77
+
78
+ $ this ->assertFalse (isset ($ xml ->div ));
79
+ $ this ->assertEquals (0 , count ($ xml ));
80
+ }
72
81
}
You can’t perform that action at this time.
0 commit comments