File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed
Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -29,10 +29,12 @@ public function loadXmlString($html)
2929 // fix invalid markup of outdated ViewVC versions
3030 // - help link in footer not terminated
3131 // - selected branch/tag in CVS "sticky tag" dropdown has not attribute value
32- // - clear button for selected branch/tag has no trailing slash
32+ // - self closing elements with no trailing slash
33+ // - excessive form close tags
3334 $ html = str_replace ('Help</strong></td> ' , 'Help</a></strong></td> ' , $ html );
3435 $ html = str_replace ('selected> ' , 'selected="selected"> ' , $ html );
35- $ html = preg_replace ('#<input([^\/]+)># ' , '<input$1 /> ' , $ html );
36+ $ html = preg_replace ('#<((?:input|br|hr|img)[^\/\>]*)># ' , '<$1 /> ' , $ html );
37+ $ html = preg_replace ('#(</table>\s*)</form>\s*(</div>)# ' , '$1$2 ' , $ html );
3638
3739 // replace named HTML entities with their UTF-8 value
3840 $ html = str_replace (array_values ($ this ->entities ), array_keys ($ this ->entities ), $ html );
Original file line number Diff line number Diff line change @@ -47,6 +47,12 @@ public function testLoadInvalidMarkupInputNotClosed()
4747 $ this ->assertEquals ('hidden ' , (string )$ xml ['type ' ]);
4848 }
4949
50+ public function testPrepareInvalidMarkupBrNotClosed ()
51+ {
52+ $ html = '<br> ' ;
53+ $ xml = $ this ->loader ->loadXmlString ($ html );
54+ }
55+
5056 public function testLoadInvalidMarkupSelectedAttributeNoValue ()
5157 {
5258 $ str = '<option selected>this</option> ' ;
You can’t perform that action at this time.
0 commit comments