Ticket #1486003 (closed Bugs: fixed)

Opened 13 months ago

Last modified 12 months ago

A sample email to debug HTML-view and a suggestion to make HTML-view more usable

Reported by: lafcadio Owned by:
Priority: 8 Milestone: 0.3-stable
Component: PHP backend Version: svn-trunk
Severity: normal Keywords: HTML-view display
Cc: brian, suporte@…

Description

Hello

I attach a sample multipart mail who's HTML-part is displayed more than very poorly by roundcube (the main part is left out). (The file is taken directly from a courier Maildir.)

I switched off the 'display HTML'-option for all accounts now because it is really a catastrophe.

SUGGESTION: Add a 'view plain-text version'-link like the 'HTML-message'-link which is displayed when the 'display HTML'-option is off.

Excuse my english, regards, L.

Attachments

susannes_mail (11.3 KB) - added by lafcadio 13 months ago.
sample multipart/alternative mail which is badliest displayed by RoundCube
Apple Store Order Acknowledgment.eml.txt (27.8 KB) - added by brian 13 months ago.
Apple Store Order Confirmation. It has the problem. I stripped out personal information. Please let me know if you need this in a different format.

Change History

Changed 13 months ago by lafcadio

sample multipart/alternative mail which is badliest displayed by RoundCube

  Changed 13 months ago by alec

  • component changed from Other to MIME parsing
  • milestone changed from later to 0.3-stable

  Changed 13 months ago by alec

Here the problem is with <ho.peter@…> tag. We could display contents of non-standard (unknown) tags, but unfortunately there're other DOMDocument issues with it. E.g. parser has got a problem with a dot in tag name. In this case at the end of message will be added:

.peter@onlinehome.de>

  Changed 13 months ago by alec

  • status changed from new to closed
  • resolution set to fixed

Fixed in r2802.

  Changed 13 months ago by alec

  • component changed from MIME parsing to PHP backend

  Changed 13 months ago by brian

  • status changed from closed to reopened
  • resolution fixed deleted

Change introduced regression for HTML tags with attributes... eg: <html xmlns="http://www.w3.org/1999/xhtml">

The above tag should not display anything... but displays: xmlns="http://www.w3.org/1999/xhtml">

My fix was to partially revert the change in: trunk/roundcubemail/program/steps/mail/func.inc Starting at line: 675

  // special replacements (not properly handled by washtml class)
  $html_search = array(
    '/(<\/nobr>)(\s+)(<nobr>)/i',	// space(s) between <NOBR>
    '/<html[^>]*>/im',				// malformed html: remove html tags (#1485139)
    '/<\/html>/i',					// malformed html: remove html tags (#1485139)
    '/<title>.*<\/title>/i',		// PHP bug #32547 workaround: remove title tag
    '/^(\0\0\xFE\xFF|\xFF\xFE\0\0|\xFE\xFF|\xFF\xFE|\xEF\xBB\xBF)/',	// byte-order mark (only outlook?)
  );
  $html_replace = array(
    '\\1'.' &nbsp; '.'\\3',
    '',
    '',
    '',
    '',
  );
  $html = preg_replace($html_search, $html_replace, $html);

  Changed 13 months ago by alec

Works for me, could you provide a sample message?

Changed 13 months ago by brian

Apple Store Order Confirmation. It has the problem. I stripped out personal information. Please let me know if you need this in a different format.

  Changed 13 months ago by alec

It Works for me. Make sure you've got current source code. Also write PHP version?

  Changed 13 months ago by brian

  • cc brian added

Pulled the latest SVN again. Same issue. PHP version 5.2.9. Please let me know if there is anything else I can do to help.

  Changed 13 months ago by alec

Maybe clear browser's cache?

  Changed 13 months ago by brian

Not sure how that would have an impact. I apply the change that I proposed and it works... remove the change and it breaks. It's instant. Does not require reload.

I did clear the cache, just to see, but no change.

follow-up: ↓ 12   Changed 12 months ago by alec

Test with PHP 5.2.10, please?

in reply to: ↑ 11   Changed 12 months ago by netbit

  • cc suporte@… added

I've tested the sample message (Apple Store Order Acknowledgment.eml.txt) with PHP 5.2.10 / RC current-trunk and can confirm this bug.

Restoring '/<html[>]*>/im' to $html_search as proposed by Brian solved the problem here.

follow-up: ↓ 14   Changed 12 months ago by alec

  • status changed from reopened to closed
  • resolution set to fixed

Fixed in r2878?

in reply to: ↑ 13   Changed 12 months ago by netbit

  • status changed from closed to reopened
  • version changed from 0.2.2 to svn-trunk
  • resolution fixed deleted

Replying to alec:

Fixed in r2878?

No. r2878 regex doesn't consider strings without ":[a-z]" like attached sample (<html xmlns=3D"http://www.w3.org/1999/xhtml">). Do you fix this regex Alec?

  Changed 12 months ago by alec

  • status changed from reopened to closed
  • resolution set to fixed

Fixed in r2880.

Note: See TracTickets for help on using tickets.