Changeset 4667 in subversion
- Timestamp:
- Apr 19, 2011 4:23:31 AM (2 years ago)
- Location:
- trunk/roundcubemail
- Files:
-
- 1 added
- 2 edited
-
program/lib/washtml.php (modified) (1 diff)
-
tests/mailfunc.php (modified) (2 diffs)
-
tests/src/htmlcom.txt (added)
Legend:
- Unmodified
- Added
- Removed
-
trunk/roundcubemail/program/lib/washtml.php
r4517 r4667 274 274 275 275 // Remove invalid HTML comments (#1487759) 276 $html = preg_replace('/<!--[^->]*>/', '', $html); 276 // Don't remove valid conditional comments 277 $html = preg_replace('/<!--[^->[]*>/', '', $html); 277 278 278 279 @$node->loadHTML($html); -
trunk/roundcubemail/tests/mailfunc.php
r4489 r4667 122 122 { 123 123 $part = $this->get_html_part('src/mailto.txt'); 124 124 125 125 // render HTML in normal mode 126 126 $html = rcmail_html4inline(rcmail_print_body($part, array('safe' => false)), 'foo'); … … 132 132 } 133 133 134 /** 135 * Test the elimination of HTML comments 136 */ 137 function test_html_comments() 138 { 139 $part = $this->get_html_part('src/htmlcom.txt'); 140 $washed = rcmail_print_body($part, array('safe' => true)); 141 142 // #1487759 143 $this->assertPattern('|<p>test1</p>|', $washed, "Buggy HTML comments"); 144 // but conditional comments (<!--[if ...) should be removed 145 $this->assertNoPattern('|<p>test2</p>|', $washed, "Conditional HTML comments"); 146 } 147 134 148 }
Note: See TracChangeset
for help on using the changeset viewer.
