Bug 139360 - mail/squirrelmail 1.4.20-RC2 Japanese text corruption in Forward/Reply forms
Summary: mail/squirrelmail 1.4.20-RC2 Japanese text corruption in Forward/Reply forms
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Thomas Abthorpe
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-10-05 06:30 UTC by Kazuo Dohzono
Modified: 2009-11-07 11:10 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kazuo Dohzono 2009-10-05 06:30:01 UTC
When I tried to forward/reply a Japanese text message, they corrupts
and I can't read them. I've compared their forms with 1.4.18 using
"Save form as...".

1.4.18:
meta tag's content-charset: EUC-JP
texts in labels/buttons: EUC-JP
texts in text boxes: EUC-JP

1.4.20-RC2:
meta tag's content-charset: EUC-JP
texts in labels/buttons: EUC-JP
texts in text boxes: JIS[*]

[*]: You can see charactor byte '0x1b' in the Japanese message strings
in To/CC/BCC/Subject fields and body part. This can't be happen with
EUC-JP.

I'll work on this issue for a little bit more, but I would like someone
to help cause I'm not familiar with PHP...

How-To-Repeat: 1) Prepare a browser which can read Japanese (for example,
www/firefox3).
2) Set squirrelamil's user language to Japanese. 
3) Send Japanese texts to your mail address. 
4) Try to forward/reply against the mail. 
5) "Save form as..." to save the form (compose.php.html).
Comment 1 Thomas Abthorpe freebsd_committer freebsd_triage 2009-10-05 06:52:05 UTC
Responsible Changed
From-To: freebsd-ports-bugs->tabthorpe

I'll take it.
Comment 2 Kazuo Dohzono 2009-10-06 09:18:48 UTC
I've found a eregi() -> preg_match() replacement mismatch. This causes
i18n.php to prevent Japanese decoding.

Would anyone send this back to squirrelmail team, please?


--- i18n.php.orig        2009-10-06 17:10:48.000000000 +0900
+++ i18n.php        2009-10-06 17:13:51.000000000 +0900
@@ -675,7 +675,7 @@
             break;
         case 'decodeheader':
             $ret = str_replace("\t", "", $ret);
-            if (preg_match('/=\?([^?]+)\?(q|b)\?([^?]+)\?=/', $ret))
+            if (preg_match('/=\?([^?]+)\?(q|b)\?([^?]+)\?=/i', $ret))
                 $ret = @mb_decode_mimeheader($ret);
             $ret = @mb_convert_encoding($ret, 'EUC-JP', 'AUTO');
             break;
Comment 3 dfilter service freebsd_committer freebsd_triage 2009-10-29 18:44:39 UTC
tabthorpe    2009-10-29 18:44:24 UTC

  FreeBSD ports repository

  Modified files:
    mail/squirrelmail    Makefile 
    mail/squirrelmail/files patch-functions__i18n.php 
  Log:
  - Fix Japanese (and possibly other) text corruption on forward/reply
  - Bump PORTREVISION
  
  PR:             ports/139360
  Submitted by:   Kazuo Dohzono <dohzono axion-software.com>
  
  Revision  Changes    Path
  1.65      +1 -1      ports/mail/squirrelmail/Makefile
  1.2       +12 -3     ports/mail/squirrelmail/files/patch-functions__i18n.php
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
Comment 4 Thomas Abthorpe freebsd_committer freebsd_triage 2009-10-29 18:44:52 UTC
State Changed
From-To: open->closed

Committed. Thanks!
Comment 5 Kazuo Dohzono 2009-11-07 11:06:58 UTC
It seems that the committed diff is not the line which I mentioned...

My diff:
- if (preg_match('/=\?([^?]+)\?(q|b)\?([^?]+)\?=/', $ret))
+ if (preg_match('/=\?([^?]+)\?(q|b)\?([^?]+)\?=/i', $ret))

Committed diff:
-    if (preg_match("/^.*\/.*\/.*\/.*\/.*\/.*$/",$ret)) {
+    if (preg_match("/^.*\/.*\/.*\/.*\/.*\/.*$/i",$ret)) {