From d4f20027c5fc4d0d8ff6ad724c941b78a321bfa4 Mon Sep 17 00:00:00 2001 From: tokul Date: Sun, 16 May 2004 09:11:04 +0000 Subject: [PATCH] text in compose form is converted to 8bit symbols. html codes conflict with output sanitizing git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@7466 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- src/compose.php | 49 ++++++++++++++++++++++++++++--------------------- 1 file changed, 28 insertions(+), 21 deletions(-) diff --git a/src/compose.php b/src/compose.php index 949dbb1b..2e9724f3 100644 --- a/src/compose.php +++ b/src/compose.php @@ -583,6 +583,13 @@ function newMail ($mailbox='', $passed_id='', $passed_ent_id='', $action='', $se $composeMessage; global $languages, $squirrelmail_language, $default_charset; + /* + * Set $default_charset to correspond with the user's selection + * of language interface. $default_charset global is not correct, + * if message is composed in new window. + */ + set_my_charset(); + $send_to = $send_to_cc = $send_to_bcc = $subject = $identity = ''; $mailprio = 3; @@ -649,7 +656,7 @@ function newMail ($mailbox='', $passed_id='', $passed_ent_id='', $action='', $se } if ( $actual && is_conversion_safe($actual) && $actual != $default_charset){ - $bodypart = charset_decode($actual,$bodypart); + $bodypart = charset_convert($actual,$bodypart,$default_charset); } $body .= $bodypart; @@ -986,11 +993,11 @@ function showInputForm ($session, $values=false) { /* display select list for identities */ if (count($idents) > 1) { - $ident_list = array(); - foreach($idents as $id => $data) { - $ident_list[$id] = - $data['full_name'].' <'.$data['email_address'].'>'; - } + $ident_list = array(); + foreach($idents as $id => $data) { + $ident_list[$id] = + $data['full_name'].' <'.$data['email_address'].'>'; + } echo ' ' . "\n" . html_tag( 'td', '', 'right', $color[4], 'width="10%"' ) . _("From:") . '' . "\n" . @@ -1013,14 +1020,14 @@ function showInputForm ($session, $values=false) { html_tag( 'td', '', 'right', $color[4] ) . _("CC:") . '' . "\n" . html_tag( 'td', '', 'left', $color[4] ) . - addInput('send_to_cc', $send_to_cc, 60). '
' . "\n" . + addInput('send_to_cc', $send_to_cc, 60). '
' . "\n" . ' ' . "\n" . ' ' . "\n" . ' ' . "\n" . html_tag( 'td', '', 'right', $color[4] ) . _("BCC:") . '' . "\n" . html_tag( 'td', '', 'left', $color[4] ) . - addInput('send_to_bcc', $send_to_bcc, 60).'
' . "\n" . + addInput('send_to_bcc', $send_to_bcc, 60).'
' . "\n" . ' ' . "\n" . ' ' . "\n" . ' ' . "\n" . @@ -1141,8 +1148,8 @@ function showInputForm ($session, $values=false) { $s_a[] = '
'. - addCheckBox('delete[]', FALSE, $key). - "\n" . $attached_filename . + addCheckBox('delete[]', FALSE, $key). + "\n" . $attached_filename . '- ' . $type . '('. show_readable_size( filesize( $attached_file ) ) . ')
'."\n"; } @@ -1169,18 +1176,18 @@ function showInputForm ($session, $values=false) { } echo '' . "\n" . - addHidden('username', $username). - addHidden('smaction', $action). - addHidden('mailbox', $mailbox); + addHidden('username', $username). + addHidden('smaction', $action). + addHidden('mailbox', $mailbox); /* store the complete ComposeMessages array in a hidden input value so we can restore them in case of a session timeout. */ sqgetGlobalVar('QUERY_STRING', $queryString, SQ_SERVER); echo addHidden('restoremessages', serialize($compose_messages)). - addHidden('composesession', $composesession). - addHidden('querystring', $queryString). - "\n"; + addHidden('composesession', $composesession). + addHidden('querystring', $queryString). + "\n"; if (!(bool) ini_get('file_uploads')) { /* File uploads are off, so we didn't show that part of the form. To avoid bogus bug reports, tell the user why. */ @@ -1208,16 +1215,16 @@ function showComposeButtonRow() { } echo ' ' . _("Priority") . addSelect('mailprio', array( - '1' => _("High"), - '3' => _("Normal"), - '5' => _("Low") ), $mailprio, TRUE); + '1' => _("High"), + '3' => _("Normal"), + '5' => _("Low") ), $mailprio, TRUE); } $mdn_user_support=getPref($data_dir, $username, 'mdn_user_support',$default_use_mdn); if ($default_use_mdn) { if ($mdn_user_support) { echo ' ' . _("Receipt") .': '. - addCheckBox('request_mdn', $request_mdn == '1', '1'). _("On Read"). - addCheckBox('request_dr', $request_dr == '1', '1'). _("On Delivery"); + addCheckBox('request_mdn', $request_mdn == '1', '1'). _("On Read"). + addCheckBox('request_dr', $request_dr == '1', '1'). _("On Delivery"); } } -- 2.25.1