Ticket #1484391 (closed Bugs: fixed)
DOCTYPE Tag Filtering Fails When Tag Contains CRLF
| Reported by: | brian | Owned by: | |
|---|---|---|---|
| Priority: | 5 | Milestone: | 0.2-alpha |
| Component: | Client Scripts | Version: | svn-trunk |
| Severity: | minor | Keywords: | |
| Cc: |
Description
r575 added the filtering of !DOCTYPE tags. The regexp used though, doesn't work if the DOCTYPE tag spans multiple lines (has a CRLF in the middle of the <> tags). It removes the first line of the DOCTYPE tag, and then the remainder appears as text in the message.
Sample Email with problem (source):
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3. org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
How Code Looks with r575:
<!--<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.--> org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
I updated the code in program/steps/mail/func.inc at line 1211, and the problem has been resolved.
Original lines 1210-1212 (from r575):
$out = preg_replace(array(
'/(<!DOCTYPE.+)/i',
'/(<\/?html[^>]*>)/i',
Modified lines 1210-1212:
$out = preg_replace(array(
'/(<\/?!DOCTYPE[^>]*>)/i',
'/(<\/?html[^>]*>)/i',
Attachments
Change History
Note: See
TracTickets for help on using
tickets.
