Changeset 5a6ad20 in github
- Timestamp:
- Mar 13, 2007 8:39:51 PM (6 years ago)
- Branches:
- master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.6, release-0.7, release-0.8
- Children:
- 568ba39
- Parents:
- 1c7b97e8
- Files:
-
- 5 edited
-
CHANGELOG (modified) (1 diff)
-
program/include/rcube_imap.inc (modified) (2 diffs)
-
program/lib/Mail/mime.php (modified) (1 diff)
-
program/steps/mail/get.inc (modified) (1 diff)
-
program/steps/mail/sendmail.inc (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
CHANGELOG
r02479770 r5a6ad20 2 2 --------------------------- 3 3 4 2007/03/13 (thomasb) 5 ---------- 6 - Applied patch for attachment download by crichardson (closes #1484198) 7 - Fixed bug in Postgres DB handling (closes #1484068) 8 - Fixed bug of invalid calls to fetchRow() in rcube_db.inc (closes #1484280) 9 - Fixed array_merge bug (closes #1484281) 10 - Fixed flag for deletion in list view (closes #1484264) 11 - Finally support semicolons as recipient separator (closes ##1484251) 12 - Fixed message headers (subject) encoding 13 14 4 15 2007/03/04 (tomekp) 16 ---------- 5 17 - check if safe mode is on or not (closes #1484269) 18 6 19 7 20 2007/03/02 (thomasb) -
program/include/rcube_imap.inc
re6c7c3c r5a6ad20 2455 2455 { 2456 2456 // remove any newlines and carriage returns before 2457 $a = $this->_explode_quoted_string(' ,', preg_replace( "/[\r\n]/", " ", $str));2457 $a = $this->_explode_quoted_string('[,;]', preg_replace( "/[\r\n]/", " ", $str)); 2458 2458 $result = array(); 2459 2459 … … 2482 2482 function _explode_quoted_string($delimiter, $string) 2483 2483 { 2484 $quotes = explode("\"", $string); 2485 foreach ($quotes as $key => $val) 2486 if (($key % 2) == 1) 2487 $quotes[$key] = str_replace($delimiter, "_!@!_", $quotes[$key]); 2488 2489 $string = implode("\"", $quotes); 2490 2491 $result = explode($delimiter, $string); 2492 foreach ($result as $key => $val) 2493 $result[$key] = str_replace("_!@!_", $delimiter, $result[$key]); 2494 2484 $result = array(); 2485 $strlen = strlen($string); 2486 for ($q=$p=$i=0; $i < $strlen; $i++) 2487 { 2488 if ($string{$i} == "\"" && $string{$i-1} != "\\") 2489 $q = $q ? false : true; 2490 else if (!$q && preg_match("/$delimiter/", $string{$i})) 2491 { 2492 $result[] = substr($string, $p, $i - $p); 2493 $p = $i + 1; 2494 } 2495 } 2496 2497 $result[] = substr($string, $p); 2495 2498 return $result; 2496 2499 } -
program/lib/Mail/mime.php
rb517af4 r5a6ad20 837 837 // quoted-printable encoding has been selected 838 838 $mode = 'Q'; 839 $encoded = preg_replace('/([\x2 0-\x25\x2C\x80-\xFF])/e', "'='.sprintf('%02X', ord('\\1'))", $value);839 $encoded = preg_replace('/([\x2C\x3F\x80-\xFF])/e', "'='.sprintf('%02X', ord('\\1'))", $value); 840 840 // replace spaces with _ 841 $encoded = str_replace(' =20', '_', $encoded);841 $encoded = str_replace(' ', '_', $encoded); 842 842 } 843 843 -
program/steps/mail/get.inc
rbb85623 r5a6ad20 64 64 $filename = $part->d_parameters['filename'] ? $part->d_parameters['filename'] : $part->ctype_parameters['name']; 65 65 66 // send correct headers for content type and length 66 header("Expires: 0"); 67 header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); 68 header("Cache-Control: private", false); 69 header("Content-Transfer-Encoding: binary"); 70 header(sprintf('Content-Disposition: attachment; filename="%s";', 71 $filename ? rcube_imap::decode_mime_string($filename) : "roundcube.$ctype_secondary")); 72 73 // send download headers 67 74 if ($_GET['_download']) 68 75 { 69 // send download headers76 header("Cache-Control: private", false); 70 77 header("Content-Type: application/octet-stream"); 71 header(sprintf('Content-Disposition: attachment; filename="%s"',72 $filename ? rcube_imap::decode_mime_string($filename) : "roundcube.$ctype_secondary"));73 78 } 74 79 else 75 {76 80 header("Content-Type: $mimetype"); 77 header(sprintf('Content-Disposition: inline; filename="%s"', rcube_imap::decode_mime_string($filename)));78 }79 81 80 82 // We need to set the following headers to make downloads work using IE in HTTPS mode. -
program/steps/mail/sendmail.inc
r24fe97e r5a6ad20 152 152 $message_charset = isset($_POST['_charset']) ? $_POST['_charset'] : $input_charset; 153 153 154 $mailto_regexp = array('/[,;]\s*[\r\n]+/', '/[\r\n]+/', '/[,;]\s*$/m' );155 $mailto_replace = array(', ', ', ', '' );154 $mailto_regexp = array('/[,;]\s*[\r\n]+/', '/[\r\n]+/', '/[,;]\s*$/m', '/;/'); 155 $mailto_replace = array(', ', ', ', '', ','); 156 156 157 157 // replace new lines and strip ending ', ' … … 171 171 $headers = array('Date' => date('D, j M Y H:i:s O'), 172 172 'From' => rcube_charset_convert($identity_arr['string'], $CHARSET, $message_charset), 173 'To' => rcube_charset_convert($mailto, $input_charset, $message_charset));173 'To' => $mailto); 174 174 175 175 // additional recipients … … 302 302 unset($MAIL_MIME->_parts); 303 303 304 // encoding subject header with mb_encode provides better results with asian characters 304 305 if ($MBSTRING && function_exists("mb_encode_mimeheader")) 305 306 { 306 307 mb_internal_encoding($message_charset); 307 $ headers['Subject']= mb_encode_mimeheader($headers['Subject'], $message_charset, 'Q');308 $mb_subject = mb_encode_mimeheader($headers['Subject'], $message_charset, 'Q'); 308 309 mb_internal_encoding($CHARSET); 309 310 } … … 327 328 unset($send_headers['Bcc']); 328 329 329 // generate message headers330 $header_str = $MAIL_MIME->txtHeaders($send_headers);330 if (!empty($mb_subject)) 331 $send_headers['Subject'] = $mb_subject; 331 332 332 333 // send message 333 334 $smtp_response = array(); 334 $sent = smtp_mail($from, $a_recipients, $ header_str, $msg_body, $smtp_response);335 $sent = smtp_mail($from, $a_recipients, $MAIL_MIME->txtHeaders($send_headers), $msg_body, $smtp_response); 335 336 336 337 // log error … … 353 354 unset($headers_php['To'], $headers_php['Subject']); 354 355 356 if (!empty($mb_subject)) 357 $headers_enc['Subject'] = $mb_subject; 358 355 359 // reset stored headers and overwrite 356 360 $MAIL_MIME->_headers = array(); … … 358 362 359 363 if (ini_get('safe_mode')) 360 $sent = mail($headers_enc['To'], $headers ['Subject'], $msg_body, $header_str);364 $sent = mail($headers_enc['To'], $headers_enc['Subject'], $msg_body, $header_str); 361 365 else 362 $sent = mail($headers_enc['To'], $headers ['Subject'], $msg_body, $header_str, "-f$from");366 $sent = mail($headers_enc['To'], $headers_enc['Subject'], $msg_body, $header_str, "-f$from"); 363 367 } 364 368
Note: See TracChangeset
for help on using the changeset viewer.
