removing help translations. cy_GB
[squirrelmail.git] / src / compose.php
index 7e568bc4aa4f0ae538d3126dd75470e049ee44c6..752aa3cfb04e424172deecbd554d39bfdd724b8b 100644 (file)
@@ -73,7 +73,7 @@ sqgetGlobalVar('draft_id',$draft_id);
 sqgetGlobalVar('ent_num',$ent_num);
 sqgetGlobalVar('saved_draft',$saved_draft);
 sqgetGlobalVar('delete_draft',$delete_draft);
-sqgetGlobalVar('startmessage',$startMessage);
+sqgetGlobalVar('startMessage',$startMessage);
 
 /** POST VARS */
 sqgetGlobalVar('sigappend',             $sigappend,             SQ_POST);
@@ -128,6 +128,11 @@ function replyAllString($header) {
    $url_replytoallcc = '';
    foreach( $url_replytoall_ar as $email => $personal) {
       if ($personal) {
+         // if personal name contains address separator then surround
+         // the personal name with double quotes.
+         if (strpos($personal,',') !== false) {
+             $personal = '"'.$personal.'"';
+         }
          $url_replytoallcc .= ", $personal <$email>";
       } else {
          $url_replytoallcc .= ', '. $email;
@@ -557,7 +562,7 @@ function newMail ($mailbox='', $passed_id='', $passed_ent_id='', $action='', $se
            $use_signature, $composesession, $data_dir, $username,
            $username, $key, $imapServerAddress, $imapPort, $compose_messages,
            $composeMessage;
-    global $languages, $squirrelmail_language;
+    global $languages, $squirrelmail_language, $default_charset;
 
     $send_to = $send_to_cc = $send_to_bcc = $subject = $identity = '';
     $mailprio = 3;
@@ -614,6 +619,17 @@ function newMail ($mailbox='', $passed_id='', $passed_ent_id='', $action='', $se
                     $bodypart = $languages[$squirrelmail_language]['XTRA_CODE']('decode', $bodypart);
                 }
             }
+           
+           if (isset($body_part_entity->header->parameters['charset'])) {
+            $actual = $body_part_entity->header->parameters['charset'];
+        } else {
+            $actual = 'us-ascii';
+        }
+
+           if ( $actual && is_conversion_safe($actual) && $actual != $default_charset){
+               $bodypart = charset_decode($actual,$bodypart);
+           }
+           
             $body .= $bodypart;
         }
         if ($default_use_priority) {
@@ -990,13 +1006,13 @@ function showInputForm ($session, $values=false) {
     if ($compose_new_win == '1') {
         echo '   <TR>' . "\n" .
              '      <TD BGCOLOR="' . $color[0] . '" COLSPAN=2 ALIGN=CENTER>' . "\n" .
-             '         <TEXTAREA NAME=body ROWS=20 COLS="' .
+             '         <TEXTAREA NAME=body ID=body ROWS=20 COLS="' .
                        $editor_size . '" WRAP="VIRTUAL">';
     }
     else {
         echo '   <TR>' . "\n" .
             '      <TD BGCOLOR="' . $color[4] . '" COLSPAN=2>' . "\n" .
-            '         &nbsp;&nbsp;<TEXTAREA NAME=body ROWS=20 COLS="' .
+            '         &nbsp;&nbsp;<TEXTAREA NAME=body ID=body ROWS=20 COLS="' .
                       $editor_size . '" WRAP="VIRTUAL">';
     }
 
@@ -1516,4 +1532,4 @@ function deliverMessage($composeMessage, $draft=false) {
     return $succes;
 }
 
-?>
\ No newline at end of file
+?>