From nobody@FreeBSD.org  Mon Oct  5 05:26:21 2009
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 95AD81065670
	for <freebsd-gnats-submit@FreeBSD.org>; Mon,  5 Oct 2009 05:26:21 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id 845E28FC1E
	for <freebsd-gnats-submit@FreeBSD.org>; Mon,  5 Oct 2009 05:26:21 +0000 (UTC)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.3/8.14.3) with ESMTP id n955QKKU092976
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 5 Oct 2009 05:26:20 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.3/8.14.3/Submit) id n955QKxU092975;
	Mon, 5 Oct 2009 05:26:20 GMT
	(envelope-from nobody)
Message-Id: <200910050526.n955QKxU092975@www.freebsd.org>
Date: Mon, 5 Oct 2009 05:26:20 GMT
From: Kazuo Dohzono <dohzono@axion-software.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: squirrelmail-1.4.20-RC2 Japanese text corruption in Forward/Reply forms
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         139360
>Category:       ports
>Synopsis:       mail/squirrelmail 1.4.20-RC2 Japanese text corruption in Forward/Reply forms
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    tabthorpe
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Oct 05 05:30:01 UTC 2009
>Closed-Date:    Thu Oct 29 18:44:54 UTC 2009
>Last-Modified:  Sat Nov  7 11:10:02 UTC 2009
>Originator:     Kazuo Dohzono
>Release:        FreeBSD 7.2-STABLE
>Organization:
>Environment:
FreeBSD dohzono.vmware.axion-software.com 7.2-STABLE FreeBSD 7.2-STABLE #0: Sat Aug 
8 16:17:25 JST 2009     dohzono@:/usr/local/tmp/obj/usr/src/sys/GENERIC  i386

>Description:
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). 
>Fix:


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->tabthorpe 
Responsible-Changed-By: tabthorpe 
Responsible-Changed-When: Mon Oct 5 05:52:05 UTC 2009 
Responsible-Changed-Why:  
I'll take it. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=139360 

From: Kazuo Dohzono <dohzono@axion-software.com>
To: bug-followup@FreeBSD.org, dohzono@axion-software.com
Cc:  
Subject: Re: ports/139360: squirrelmail-1.4.20-RC2 Japanese text corruption in 
	Forward/Reply forms
Date: Tue, 6 Oct 2009 17:18:48 +0900

 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;
State-Changed-From-To: open->closed 
State-Changed-By: tabthorpe 
State-Changed-When: Thu Oct 29 18:44:52 UTC 2009 
State-Changed-Why:  
Committed. Thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=139360 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/139360: commit references a PR
Date: Thu, 29 Oct 2009 18:44:39 +0000 (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"
 

From: Kazuo Dohzono <dohzono@axion-software.com>
To: bug-followup@FreeBSD.org, dohzono@axion-software.com
Cc:  
Subject: Re: ports/139360: mail/squirrelmail 1.4.20-RC2 Japanese text 
	corruption in Forward/Reply forms
Date: Sat, 7 Nov 2009 20:06:58 +0900

 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)) {
>Unformatted:
