Process $body with decodeHeader()?

Takahiro Kambe <[email protected]> Thu, 24 Oct 2013 20:26:55 +0900 (JST)
Newsgroups gmane.mail.squirrelmail.devel
Message-ID <[email protected]>
Hi,

This isn't a bug report but a simple question.

In src/compose.php, body of a message is passed to decodeHeader().
Why $body is passed to decodeHeader()?

SM-1_4-STABLE: about line 1316 of src/compose.php:

    echo sm_encode_html_special_chars(decodeHeader($body,false,false,true));

trunk: about line 1398 of src/compose.php:

    $body_str = sm_encode_html_special_chars(decodeHeader($body,false,false));

There was a bad scenario.

1. Accidently (or intentionally) body text contains encoded MIME
   header string such as "=?iso-2022-jp?B ...".

2. decodeHeader() decodes such ""=?iso-2022-jp?B ..." string into
   iso-2022-jp (or other none UTF-8 string) encoded string.

3. Body is expected to UTF-8 or EUC-JP and really contain such string
   in the encoding.

4. As a result, multiple text encopding are miexed and it cause
   strange garbled characters.

I hope $body should be already properly encoded and no need to decode
header any more at that time.

Best regards.

-- 
Takahiro Kambe <[email protected]>

------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60135991&iu=/4140/ostg.clktrk
-----
squirrelmail-devel mailing list
Posting guidelines: http://squirrelmail.org/postingguidelines
List address: [email protected]
List archives: http://news.gmane.org/gmane.mail.squirrelmail.devel
List info (subscribe/unsubscribe/change options): https://lists.sourceforge.net/lists/listinfo/squirrelmail-devel