No decodeHeader inside the form because we already did that because we had
authorstekkel <stekkel@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sat, 1 Mar 2003 22:07:10 +0000 (22:07 +0000)
committerstekkel <stekkel@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sat, 1 Mar 2003 22:07:10 +0000 (22:07 +0000)
to add Re Fwd information.
So the lesson is:
NEVER use double decodeHeader!!!

git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@4576 7612ce4b-ef26-0410-bec9-ea0150e637f0

src/compose.php

index ea74ff996931c6687e105454bba9a70ebbcc5541..d1ebff502e6f9762a09a8cc795c7d03f68792094 100644 (file)
@@ -623,8 +623,7 @@ function newMail ($mailbox='', $passed_id='', $passed_ent_id='', $action='', $se
             $send_to = $orig_header->getAddr_s('to');
             $send_to_cc = $orig_header->getAddr_s('cc');
             $send_to_bcc = $orig_header->getAddr_s('bcc');
-            $subject = $orig_header->subject;
-
+            $subject = decodeHeader($orig_header->subject,true,false);
             $body_ary = explode("\n", $body);
             $cnt = count($body_ary) ;
             $body = '';
@@ -642,7 +641,7 @@ function newMail ($mailbox='', $passed_id='', $passed_ent_id='', $action='', $se
             $send_to = $orig_header->getAddr_s('to');
             $send_to_cc = $orig_header->getAddr_s('cc');
             $send_to_bcc = $orig_header->getAddr_s('bcc');
-            $subject = $orig_header->subject;
+            $subject = decodeHeader($orig_header->subject,true,false);
             $mailprio = $orig_header->priority;
             $orig_from = '';
             $composeMessage = getAttachments($message, $composeMessage, $passed_id, $entities, $imapConnection);
@@ -651,7 +650,7 @@ function newMail ($mailbox='', $passed_id='', $passed_ent_id='', $action='', $se
         case ('forward'):
             $send_to = '';
             $subject = decodeHeader($orig_header->subject,true,false);
-            if ((substr(strtolower($subject), 0, 4) != 'fwd:') &&
+           if ((substr(strtolower($subject), 0, 4) != 'fwd:') &&
                 (substr(strtolower($subject), 0, 5) != '[fwd:') &&
                 (substr(strtolower($subject), 0, 6) != '[ fwd:')) {
                 $subject = '[Fwd: ' . $subject . ']';
@@ -676,7 +675,7 @@ function newMail ($mailbox='', $passed_id='', $passed_ent_id='', $action='', $se
             } else {
                 $send_to = $orig_header->getAddr_s('from');
             }
-            $subject =  $orig_header->subject;
+            $subject = decodeHeader($orig_header->subject,true,false);
             $subject = str_replace('"', "'", $subject);
             $subject = trim($subject);
             if (substr(strtolower($subject), 0, 3) != 're:') {
@@ -934,7 +933,7 @@ function showInputForm ($session, $values=false) {
                 _("Subject:") . '</TD>' . "\n" .
                 html_tag( 'td', '', 'left', $color[4] ) . "\n";
     echo '         <INPUT TYPE=text NAME=subject SIZE=60 VALUE="' .
-                   decodeHeader($subject,false) . '">' . "\n" .
+                   $subject . '">' . "\n" .
          '      </TD>' . "\n" .
          '   </TR>' . "\n\n";