Changeset 17b5fb7 in github
- Timestamp:
- Mar 21, 2008 7:45:46 AM (5 years ago)
- Branches:
- master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.6, release-0.7, release-0.8
- Children:
- 9e60d4b
- Parents:
- 9814721
- Files:
-
- 7 edited
-
CHANGELOG (modified) (1 diff)
-
config/main.inc.php.dist (modified) (1 diff)
-
program/include/main.inc (modified) (1 diff)
-
program/include/rcube_imap.inc (modified) (7 diffs)
-
program/steps/mail/compose.inc (modified) (1 diff)
-
program/steps/mail/show.inc (modified) (1 diff)
-
program/steps/mail/viewsource.inc (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
CHANGELOG
r27564f1 r17b5fb7 1 1 CHANGELOG RoundCube Webmail 2 2 --------------------------- 3 4 2008/03/21 (thomasb) 5 ---------- 6 - Add configurable default charset for message decoding 7 3 8 4 9 2008/02/28 (thomasb) -
config/main.inc.php.dist
r81355ae r17b5fb7 180 180 // 0 = ask the user, 1 = send automatically, 2 = ignore (never send or ask) 181 181 $rcmail_config['mdn_requests'] = 0; 182 183 // Use this as charset as fallback for message decoding 184 $rcmail_config['default_charset'] = 'ISO-8859-1'; 182 185 183 186 // Make use of the built-in spell checker. It is based on GoogieSpell. -
program/include/main.inc
r9814721 r17b5fb7 291 291 { 292 292 global $CONFIG, $IMAP; 293 294 if (!empty($CONFIG['default_charset'])) 295 $IMAP->set_charset($CONFIG['default_charset']); 293 296 294 297 // set root dir from config -
program/include/rcube_imap.inc
rddc34f9 r17b5fb7 52 52 var $delimiter = NULL; 53 53 var $caching_enabled = FALSE; 54 var $default_charset = 'ISO-8859-1'; 54 55 var $default_folders = array('INBOX'); 55 56 var $default_folders_lc = array('inbox'); … … 205 206 206 207 /** 208 * Set default message charset 209 * 210 * This will be used for message decoding if a charset specification is not available 211 * 212 * @param string Charset string 213 * @access public 214 */ 215 function set_charset($cs) 216 { 217 $this->default_charset = $ch; 218 } 219 220 221 /** 207 222 * This list of folders will be listed above all other folders 208 223 * … … 1147 1162 // normalize filename property 1148 1163 if ($filename_mime = $struct->d_parameters['filename'] ? $struct->d_parameters['filename'] : $struct->ctype_parameters['name']) 1149 $struct->filename = $this->decode_mime_string($filename_mime);1164 $struct->filename = rcube_imap::decode_mime_string($filename_mime, $this->default_charset); 1150 1165 else if ($filename_encoded = $struct->d_parameters['filename*'] ? $struct->d_parameters['filename*'] : $struct->ctype_parameters['name*']) 1151 1166 { … … 1155 1170 } 1156 1171 else if (!empty($struct->headers['content-description'])) 1157 $struct->filename = $this->decode_mime_string($struct->headers['content-description']);1172 $struct->filename = rcube_imap::decode_mime_string($struct->headers['content-description'], $this->default_charset); 1158 1173 1159 1174 return $struct; … … 1242 1257 if ($o_part->ctype_primary=='text' || $o_part->ctype_primary=='message') 1243 1258 { 1244 // assume ISO-8859-1if no charset specified1259 // assume default if no charset specified 1245 1260 if (empty($o_part->charset)) 1246 $o_part->charset = 'ISO-8859-1';1261 $o_part->charset = $this->default_charset; 1247 1262 1248 1263 $body = rcube_charset_convert($body, $o_part->charset); … … 2298 2313 function decode_header($input, $remove_quotes=FALSE) 2299 2314 { 2300 $str = $this->decode_mime_string((string)$input);2315 $str = rcube_imap::decode_mime_string((string)$input, $this->default_charset); 2301 2316 if ($str{0}=='"' && $remove_quotes) 2302 2317 $str = str_replace('"', '', $str); … … 2415 2430 2416 2431 // defaults to what is specified in the class header 2417 return rcube_charset_convert($body, 'ISO-8859-1');2432 return rcube_charset_convert($body, $this->default_charset); 2418 2433 } 2419 2434 -
program/steps/mail/compose.inc
rc3c0fb7 r17b5fb7 91 91 $MESSAGE = array('UID' => $msg_uid); 92 92 $MESSAGE['headers'] = &$IMAP->get_headers($msg_uid); 93 $MESSAGE['structure'] = &$IMAP->get_structure($msg_uid); 93 $MESSAGE['structure'] = &$IMAP->get_structure($msg_uid); 94 95 if (!empty($MESSAGE['headers']->charset)) 96 $IMAP->set_charset($MESSAGE['headers']->charset); 97 94 98 $MESSAGE['subject'] = $IMAP->decode_header($MESSAGE['headers']->subject); 95 99 $MESSAGE['parts'] = $IMAP->get_mime_numbers($MESSAGE['structure']); -
program/steps/mail/show.inc
rddbdb85 r17b5fb7 30 30 $MESSAGE = array('UID' => get_input_value('_uid', RCUBE_INPUT_GET)); 31 31 $MESSAGE['headers'] = $IMAP->get_headers($MESSAGE['UID']); 32 33 // set message charset as default 34 if (!empty($MESSAGE['headers']->charset)) 35 $IMAP->set_charset($MESSAGE['headers']->charset); 32 36 33 37 // go back to list if message not found (wrong UID) -
program/steps/mail/viewsource.inc
r5349b78 r17b5fb7 6 6 | | 7 7 | This file is part of the RoundCube Webmail client | 8 | Copyright (C) 2005-200 7, RoundCube Dev. - Switzerland |8 | Copyright (C) 2005-2008, RoundCube Dev. - Switzerland | 9 9 | Licensed under the GNU GPL | 10 10 | | … … 23 23 // similar code as in program/steps/mail/get.inc 24 24 if ($uid = get_input_value('_uid', RCUBE_INPUT_GET)) 25 { 26 header('Content-Type: text/plain'); 27 //@ob_end_clean(); 25 { 26 $headers = $IMAP->get_headers($uid); 27 $charset = $headers->charset ? $headers->charset : $IMAP->default_charset; 28 header("Content-Type: text/plain; charset={$charset}"); 28 29 $IMAP->print_raw_body($uid); 29 }30 } 30 31 else 31 { 32 raise_error(array('code' => 500, 33 'type' => 'php', 34 'message' => 'Message UID '.$uid.' not found'), 35 TRUE, 36 TRUE); 37 } 32 { 33 raise_error(array( 34 'code' => 500, 35 'type' => 'php', 36 'message' => 'Message UID '.$uid.' not found'), 37 true, 38 true); 39 } 38 40 39 41 exit;
Note: See TracChangeset
for help on using the changeset viewer.
