Changeset 5402 in subversion
- Timestamp:
- Nov 9, 2011 5:03:54 AM (19 months ago)
- Location:
- branches/release-0.7
- Files:
-
- 18 edited
-
CHANGELOG (modified) (1 diff)
-
config/main.inc.php.dist (modified) (2 diffs)
-
program/include/main.inc (modified) (5 diffs)
-
program/include/rcmail.php (modified) (1 diff)
-
program/include/rcube_contacts.php (modified) (2 diffs)
-
program/include/rcube_imap.php (modified) (7 diffs)
-
program/include/rcube_imap_generic.php (modified) (4 diffs)
-
program/include/rcube_ldap.php (modified) (1 diff)
-
program/include/rcube_mdb2.php (modified) (8 diffs)
-
program/include/rcube_string_replacer.php (modified) (1 diff)
-
program/js/app.js (modified) (5 diffs)
-
program/steps/addressbook/func.inc (modified) (3 diffs)
-
program/steps/mail/autocomplete.inc (modified) (2 diffs)
-
program/steps/mail/compose.inc (modified) (5 diffs)
-
program/steps/mail/func.inc (modified) (1 diff)
-
program/steps/mail/sendmail.inc (modified) (4 diffs)
-
program/steps/settings/edit_folder.inc (modified) (1 diff)
-
program/steps/settings/folders.inc (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/release-0.7/CHANGELOG
r5374 r5402 2 2 =========================== 3 3 4 - Make email recipients separator configurable 5 - Fix so folders with \Noinferiors attribute aren't listed in parent selector 6 - Fix handling of curly brackets in URLs (#1488168) 7 - Fix handling of dates (birthday/anniversary) in contact data (#1488147) 8 - Fix error on opening searched LDAP contact (#1488144) 9 - Fix redundant line break in flowed format (#1488146) 4 10 - Fix IDN address validation issue (#1488137) 5 11 - Fix JS error when dst_active checkbox doesn't exist (#1488133) -
branches/release-0.7/config/main.inc.php.dist
r5393 r5402 6 6 | | 7 7 | This file is part of the Roundcube Webmail client | 8 | Copyright (C) 2005-201 0, The Roundcube Dev Team |8 | Copyright (C) 2005-2011, The Roundcube Dev Team | 9 9 | Licensed under the GNU GPL | 10 10 | | … … 460 460 // Makes that words with symbols will be ignored (e.g. g@@gle) 461 461 $rcmail_config['spellcheck_ignore_syms'] = false; 462 463 // Use this char/string to separate recipients when composing a new message 464 $rcmail_config['recipients_separator'] = ','; 462 465 463 466 // don't let users set pagesize to more than this value if set -
branches/release-0.7/program/include/main.inc
r5342 r5402 1019 1019 * This uses the date formatting properties from config 1020 1020 * 1021 * @param mixed Date representation (string or timestamp)1021 * @param mixed Date representation (string or timestamp) 1022 1022 * @param string Date format to use 1023 * @param bool Enables date convertion according to user timezone 1024 * 1023 1025 * @return string Formatted date string 1024 1026 */ 1025 function format_date($date, $format=NULL )1027 function format_date($date, $format=NULL, $convert=true) 1026 1028 { 1027 1029 global $RCMAIL, $CONFIG; 1028 1029 $ts = NULL;1030 1030 1031 1031 if (!empty($date)) … … 1035 1035 return ''; 1036 1036 1037 // get user's timezone offset 1038 $tz = $RCMAIL->config->get_timezone(); 1039 1040 // convert time to user's timezone 1041 $timestamp = $ts - date('Z', $ts) + ($tz * 3600); 1042 1043 // get current timestamp in user's timezone 1044 $now = time(); // local time 1045 $now -= (int)date('Z'); // make GMT time 1046 $now += ($tz * 3600); // user's time 1047 $now_date = getdate($now); 1048 1049 $today_limit = mktime(0, 0, 0, $now_date['mon'], $now_date['mday'], $now_date['year']); 1050 $week_limit = mktime(0, 0, 0, $now_date['mon'], $now_date['mday']-6, $now_date['year']); 1037 if ($convert) { 1038 // get user's timezone offset 1039 $tz = $RCMAIL->config->get_timezone(); 1040 1041 // convert time to user's timezone 1042 $timestamp = $ts - date('Z', $ts) + ($tz * 3600); 1043 1044 // get current timestamp in user's timezone 1045 $now = time(); // local time 1046 $now -= (int)date('Z'); // make GMT time 1047 $now += ($tz * 3600); // user's time 1048 } 1049 else { 1050 $now = time(); 1051 $timestamp = $ts; 1052 } 1051 1053 1052 1054 // define date format depending on current time 1053 1055 if (!$format) { 1056 $now_date = getdate($now); 1057 $today_limit = mktime(0, 0, 0, $now_date['mon'], $now_date['mday'], $now_date['year']); 1058 $week_limit = mktime(0, 0, 0, $now_date['mon'], $now_date['mday']-6, $now_date['year']); 1059 1054 1060 if ($CONFIG['prettydate'] && $timestamp > $today_limit && $timestamp < $now) { 1055 1061 $format = $RCMAIL->config->get('date_today', $RCMAIL->config->get('time_format', 'H:i')); … … 1227 1233 $select->add($p['noselection'], ''); 1228 1234 1229 rcmail_render_folder_tree_select($a_mailboxes, $mbox, $p['maxlength'], $select, $p['realnames'], 0, $p ['exceptions']);1235 rcmail_render_folder_tree_select($a_mailboxes, $mbox, $p['maxlength'], $select, $p['realnames'], 0, $p); 1230 1236 1231 1237 return $select; … … 1276 1282 1277 1283 if (!isset($arrFolders[$currentFolder])) { 1278 // Check \Noselect option (if options are in cache)1279 if (!$virtual && ($ opts = $RCMAIL->imap->mailbox_options($path))) {1280 $virtual = in_array('\\Noselect', $ opts);1284 // Check \Noselect attribute (if attributes are in cache) 1285 if (!$virtual && ($attrs = $RCMAIL->imap->mailbox_attributes($path))) { 1286 $virtual = in_array('\\Noselect', $attrs); 1281 1287 } 1282 1288 … … 1397 1403 * @return string 1398 1404 */ 1399 function rcmail_render_folder_tree_select(&$arrFolders, &$mbox_name, $maxlength, &$select, $realnames=false, $nestLevel=0, $exceptions=array()) 1400 { 1405 function rcmail_render_folder_tree_select(&$arrFolders, &$mbox_name, $maxlength, &$select, $realnames=false, $nestLevel=0, $opts=array()) 1406 { 1407 global $RCMAIL; 1408 1401 1409 $out = ''; 1402 1410 1403 1411 foreach ($arrFolders as $key => $folder) { 1404 if (empty($exceptions) || !in_array($folder['id'], $exceptions)) { 1405 if (!$realnames && ($folder_class = rcmail_folder_classname($folder['id']))) 1406 $foldername = rcube_label($folder_class); 1407 else { 1408 $foldername = $folder['name']; 1409 1410 // shorten the folder name to a given length 1411 if ($maxlength && $maxlength>1) 1412 $foldername = abbreviate_string($foldername, $maxlength); 1413 } 1414 1415 $select->add(str_repeat(' ', $nestLevel*4) . $foldername, $folder['id']); 1416 } 1417 else if ($nestLevel) 1412 // skip exceptions (and its subfolders) 1413 if (!empty($opts['exceptions']) && in_array($folder['id'], $opts['exceptions'])) { 1418 1414 continue; 1415 } 1416 1417 // skip folders in which it isn't possible to create subfolders 1418 if (!empty($opts['skip_noinferiors']) && ($attrs = $RCMAIL->imap->mailbox_attributes($folder['id'])) 1419 && in_array('\\Noinferiors', $attrs) 1420 ) { 1421 continue; 1422 } 1423 1424 if (!$realnames && ($folder_class = rcmail_folder_classname($folder['id']))) 1425 $foldername = rcube_label($folder_class); 1426 else { 1427 $foldername = $folder['name']; 1428 1429 // shorten the folder name to a given length 1430 if ($maxlength && $maxlength>1) 1431 $foldername = abbreviate_string($foldername, $maxlength); 1432 } 1433 1434 $select->add(str_repeat(' ', $nestLevel*4) . $foldername, $folder['id']); 1419 1435 1420 1436 if (!empty($folder['folders'])) 1421 1437 $out .= rcmail_render_folder_tree_select($folder['folders'], $mbox_name, $maxlength, 1422 $select, $realnames, $nestLevel+1, $ exceptions);1438 $select, $realnames, $nestLevel+1, $opts); 1423 1439 } 1424 1440 -
branches/release-0.7/program/include/rcmail.php
r5376 r5402 595 595 596 596 $this->imap = new rcube_imap(); 597 $this->imap->debug_level = $this->config->get('debug_level');598 597 $this->imap->skip_deleted = $this->config->get('skip_deleted'); 599 598 -
branches/release-0.7/program/include/rcube_contacts.php
r5328 r5402 42 42 private $filter = null; 43 43 private $result = null; 44 private $name;45 44 private $cache; 46 45 private $table_cols = array('name', 'email', 'firstname', 'surname'); … … 51 50 // public properties 52 51 public $primary_key = 'contact_id'; 52 public $name; 53 53 public $readonly = false; 54 54 public $groups = true; -
branches/release-0.7/program/include/rcube_imap.php
r5366 r5402 33 33 class rcube_imap 34 34 { 35 public $debug_level = 1;36 35 public $skip_deleted = false; 37 36 public $page_size = 10; … … 319 318 320 319 /** 320 * Activate/deactivate debug mode 321 * 322 * @param boolean $dbg True if IMAP conversation should be logged 323 * @access public 324 */ 325 function set_debug($dbg = true) 326 { 327 $this->options['debug'] = $dbg; 328 $this->conn->setDebug($dbg, array($this, 'debug_handler')); 329 } 330 331 332 /** 321 333 * Set default message charset 322 334 * … … 3076 3088 function list_unsubscribed($root='', $name='*', $filter=null, $rights=null, $skip_sort=false) 3077 3089 { 3078 // @TODO: caching 3090 $cache_key = $root.':'.$name; 3091 if (!empty($filter)) { 3092 $cache_key .= ':'.(is_string($filter) ? $filter : serialize($filter)); 3093 } 3094 $cache_key .= ':'.$rights; 3095 $cache_key = 'mailboxes.list.'.md5($cache_key); 3096 3097 // get cached folder list 3098 $a_mboxes = $this->get_cache($cache_key); 3099 if (is_array($a_mboxes)) { 3100 return $a_mboxes; 3101 } 3102 3079 3103 // Give plugins a chance to provide a list of mailboxes 3080 3104 $data = rcmail::get_instance()->plugins->exec_hook('mailboxes_list', … … 3098 3122 } 3099 3123 3124 // cache folder attributes 3125 if ($root == '' && $name == '*' && empty($filter)) { 3126 $this->update_cache('mailboxes.attributes', $this->conn->data['LIST']); 3127 } 3128 3100 3129 // filter folders list according to rights requirements 3101 3130 if ($rights && $this->get_capability('ACL')) { … … 3107 3136 $a_mboxes = $this->_sort_mailbox_list($a_mboxes); 3108 3137 } 3138 3139 // write mailboxlist to cache 3140 $this->update_cache($cache_key, $a_mboxes); 3109 3141 3110 3142 return $a_mboxes; … … 3439 3471 3440 3472 /** 3441 * Gets folder options from LIST response, e.g. \Noselect, \Noinferiors3473 * Gets folder attributes from LIST response, e.g. \Noselect, \Noinferiors 3442 3474 * 3443 3475 * @param string $mailbox Folder name 3444 * @param bool $force Set to True if options should be refreshed 3445 * Options are available after LIST command only 3476 * @param bool $force Set to True if attributes should be refreshed 3446 3477 * 3447 3478 * @return array Options list 3448 3479 */ 3449 function mailbox_ options($mailbox, $force=false)3450 { 3451 if ($mailbox == 'INBOX') {3452 return array();3453 }3454 3455 if (!is_array($this->conn->data['LIST']) || !is_array($this->conn->data['LIST'][$mailbox])) {3456 if ($force) {3457 $this->conn->listMailboxes('', $mailbox);3458 }3459 else {3460 return array(); 3461 }3462 }3463 3464 $opts = $this->conn->data['LIST'][$mailbox];3480 function mailbox_attributes($mailbox, $force=false) 3481 { 3482 // get attributes directly from LIST command 3483 if (!empty($this->conn->data['LIST']) && is_array($this->conn->data['LIST'][$mailbox])) { 3484 $opts = $this->conn->data['LIST'][$mailbox]; 3485 } 3486 // get cached folder attributes 3487 else if (!$force) { 3488 $opts = $this->get_cache('mailboxes.attributes'); 3489 $opts = $opts[$mailbox]; 3490 } 3491 3492 if (!is_array($opts)) { 3493 $this->conn->listMailboxes('', $mailbox); 3494 $opts = $this->conn->data['LIST'][$mailbox]; 3495 } 3465 3496 3466 3497 return is_array($opts) ? $opts : array(); … … 3545 3576 } 3546 3577 3547 $options['name'] = $mailbox;3548 $options[' options'] = $this->mailbox_options($mailbox, true);3549 $options['namespace'] = $this->mailbox_namespace($mailbox);3550 $options['rights'] = $acl && !$options['is_root'] ? (array)$this->my_rights($mailbox) : array();3551 $options['special'] = in_array($mailbox, $this->default_folders);3578 $options['name'] = $mailbox; 3579 $options['attributes'] = $this->mailbox_attributes($mailbox, true); 3580 $options['namespace'] = $this->mailbox_namespace($mailbox); 3581 $options['rights'] = $acl && !$options['is_root'] ? (array)$this->my_rights($mailbox) : array(); 3582 $options['special'] = in_array($mailbox, $this->default_folders); 3552 3583 3553 3584 // Set 'noselect' and 'norename' flags 3554 if (is_array($options[' options'])) {3555 foreach ($options[' options'] as $opt) {3556 $ opt = strtolower($opt);3557 if ($ opt == '\noselect' || $opt== '\nonexistent') {3585 if (is_array($options['attributes'])) { 3586 foreach ($options['attributes'] as $attrib) { 3587 $attrib = strtolower($attrib); 3588 if ($attrib == '\noselect' || $attrib == '\nonexistent') { 3558 3589 $options['noselect'] = true; 3559 3590 } -
branches/release-0.7/program/include/rcube_imap_generic.php
r5366 r5402 2243 2243 2244 2244 if ($code == self::ERROR_OK) { 2245 $folders = array(); 2246 while ($this->tokenizeResponse($response, 1) == '*') { 2247 $cmd = strtoupper($this->tokenizeResponse($response, 1)); 2245 $folders = array(); 2246 $last = 0; 2247 $pos = 0; 2248 $response .= "\r\n"; 2249 2250 while ($pos = strpos($response, "\r\n", $pos+1)) { 2251 // literal string, not real end-of-command-line 2252 if ($response[$pos-1] == '}') { 2253 continue; 2254 } 2255 2256 $line = substr($response, $last, $pos - $last); 2257 $last = $pos + 2; 2258 2259 if (!preg_match('/^\* (LIST|LSUB|STATUS) /i', $line, $m)) { 2260 continue; 2261 } 2262 $cmd = strtoupper($m[1]); 2263 $line = substr($line, strlen($m[0])); 2264 2248 2265 // * LIST (<options>) <delimiter> <mailbox> 2249 2266 if ($cmd == 'LIST' || $cmd == 'LSUB') { 2250 list($opts, $delim, $mailbox) = $this->tokenizeResponse($ response, 3);2267 list($opts, $delim, $mailbox) = $this->tokenizeResponse($line, 3); 2251 2268 2252 2269 // Add to result array … … 2259 2276 2260 2277 // Add to options array 2261 if (!empty($opts)) { 2262 if (empty($this->data['LIST'][$mailbox])) 2263 $this->data['LIST'][$mailbox] = $opts; 2264 else 2265 $this->data['LIST'][$mailbox] = array_unique(array_merge( 2266 $this->data['LIST'][$mailbox], $opts)); 2267 } 2278 if (empty($this->data['LIST'][$mailbox])) 2279 $this->data['LIST'][$mailbox] = $opts; 2280 else if (!empty($opts)) 2281 $this->data['LIST'][$mailbox] = array_unique(array_merge( 2282 $this->data['LIST'][$mailbox], $opts)); 2268 2283 } 2269 2284 // * STATUS <mailbox> (<result>) 2270 2285 else if ($cmd == 'STATUS') { 2271 list($mailbox, $status) = $this->tokenizeResponse($ response, 2);2286 list($mailbox, $status) = $this->tokenizeResponse($line, 2); 2272 2287 2273 2288 for ($i=0, $len=count($status); $i<$len; $i += 2) { … … 2275 2290 $folders[$mailbox][$name] = $value; 2276 2291 } 2277 }2278 // other untagged response line, skip it2279 else {2280 $response = ltrim($response);2281 if (($position = strpos($response, "\n")) !== false)2282 $response = substr($response, $position+1);2283 else2284 $response = '';2285 2292 } 2286 2293 } … … 3393 3400 // String atom, number, NIL, *, % 3394 3401 default: 3395 // empty or one character3396 if ($str === '' ) {3402 // empty string 3403 if ($str === '' || $str === null) { 3397 3404 break 2; 3398 }3399 if (strlen($str) < 2) {3400 $result[] = $str;3401 $str = '';3402 break;3403 3405 } 3404 3406 -
branches/release-0.7/program/include/rcube_ldap.php
r5393 r5402 1343 1343 1344 1344 /** 1345 * Activate/deactivate debug mode 1346 * 1347 * @param boolean $dbg True if LDAP commands should be logged 1348 * @access public 1349 */ 1350 function set_debug($dbg = true) 1351 { 1352 $this->debug = $dbg; 1353 } 1354 1355 1356 /** 1345 1357 * Quotes attribute value string 1346 1358 * -
branches/release-0.7/program/include/rcube_mdb2.php
r4810 r5402 36 36 class rcube_mdb2 37 37 { 38 var$db_dsnw; // DSN for write operations39 var$db_dsnr; // DSN for read operations40 var$db_connected = false; // Already connected ?41 var$db_mode = ''; // Connection mode42 var$db_handle = 0; // Connection handle43 var$db_error = false;44 var$db_error_msg = '';38 public $db_dsnw; // DSN for write operations 39 public $db_dsnr; // DSN for read operations 40 public $db_connected = false; // Already connected ? 41 public $db_mode = ''; // Connection mode 42 public $db_handle = 0; // Connection handle 43 public $db_error = false; 44 public $db_error_msg = ''; 45 45 46 46 private $debug_mode = false; 47 private $ write_failure = false;47 private $conn_failure = false; 48 48 private $a_query_results = array('dummy'); 49 49 private $last_res_id = 0; … … 59 59 function __construct($db_dsnw, $db_dsnr='', $pconn=false) 60 60 { 61 if ( $db_dsnr == '')61 if (empty($db_dsnr)) 62 62 $db_dsnr = $db_dsnw; 63 63 … … 123 123 function db_connect($mode) 124 124 { 125 // previous connection failed, don't attempt to connect again 126 if ($this->conn_failure) { 127 return; 128 } 129 130 // no replication 131 if ($this->db_dsnw == $this->db_dsnr) { 132 $mode = 'w'; 133 } 134 125 135 // Already connected 126 136 if ($this->db_connected) { 127 // connected to read-write db, current connection is ok 128 if ($this->db_mode == 'w' && !$this->write_failure) 129 return; 130 131 // no replication, current connection is ok for read and write 132 if (empty($this->db_dsnr) || $this->db_dsnw == $this->db_dsnr) { 133 $this->db_mode = 'w'; 137 // connected to db with the same or "higher" mode 138 if ($this->db_mode == 'w' || $this->db_mode == $mode) { 134 139 return; 135 140 } 136 137 // Same mode, current connection is ok138 if ($this->db_mode == $mode)139 return;140 141 } 141 142 142 143 $dsn = ($mode == 'r') ? $this->db_dsnr : $this->db_dsnw; 143 144 144 $this->db_handle = $this->dsn_connect($dsn);145 $this->db_handle = $this->dsn_connect($dsn); 145 146 $this->db_connected = !PEAR::isError($this->db_handle); 146 147 147 148 if ($this->db_connected) 148 $this->db_mode = $mode; 149 $this->db_mode = $mode; 150 else 151 $this->conn_failure = true; 149 152 } 150 153 … … 256 259 // Read or write ? 257 260 $mode = (strtolower(substr(trim($query),0,6)) == 'select') ? 'r' : 'w'; 258 259 // don't event attempt to connect if previous write-operation failed260 if ($this->write_failure && $mode == 'w')261 return false;262 261 263 262 $this->db_connect($mode); … … 285 284 'line' => __LINE__, 'file' => __FILE__, 286 285 'message' => $this->db_error_msg), true, false); 287 286 288 287 $result = false; 289 288 } … … 293 292 } 294 293 } 295 296 // remember that write-operation failed297 if ($mode == 'w' && ($result === false || PEAR::isError($result)))298 $this->write_failure = true;299 294 300 295 // add result, even if it's an error … … 448 443 return $result; 449 444 } 450 445 451 446 return null; 452 447 } … … 531 526 function now() 532 527 { 533 switch ($this->db_provider) {528 switch ($this->db_provider) { 534 529 case 'mssql': 535 530 case 'sqlsrv': -
branches/release-0.7/program/include/rcube_string_replacer.php
r5198 r5402 40 40 $utf_domain = '[^?&@"\'\\/()\s\r\t\n]+\\.([^\\x00-\\x2f\\x3b-\\x40\\x5b-\\x60\\x7b-\\x7f]{2,}|xn--[a-z0-9]{2,})'; 41 41 $url1 = '.:;,'; 42 $url2 = 'a-z0-9%=#@+?&\\/_~\\[\\] -';42 $url2 = 'a-z0-9%=#@+?&\\/_~\\[\\]{}-'; 43 43 44 44 $this->link_pattern = "/([\w]+:\/\/|\Wwww\.)($utf_domain([$url1]?[$url2]+)*)/i"; -
branches/release-0.7/program/js/app.js
r5343 r5402 21 21 function rcube_webmail() 22 22 { 23 this.env = { };23 this.env = { recipients_separator:',', recipients_delimiter:', ' }; 24 24 this.labels = {}; 25 25 this.buttons = {}; … … 2927 2927 this.init_address_input_events = function(obj, props) 2928 2928 { 2929 this.env.recipients_delimiter = this.env.recipients_separator + ' '; 2930 2929 2931 obj[bw.ie || bw.safari || bw.chrome ? 'keydown' : 'keypress'](function(e) { return ref.ksearch_keydown(e, this, props); }) 2930 2932 .attr('autocomplete', 'off'); … … 3591 3593 // insert all members of a group 3592 3594 if (typeof this.env.contacts[id] === 'object' && this.env.contacts[id].id) { 3593 insert += this.env.contacts[id].name + ', ';3595 insert += this.env.contacts[id].name + this.env.recipients_delimiter; 3594 3596 this.group2expand = $.extend({}, this.env.contacts[id]); 3595 3597 this.group2expand.input = this.ksearch_input; … … 3597 3599 } 3598 3600 else if (typeof this.env.contacts[id] === 'string') { 3599 insert = this.env.contacts[id] + ', ';3601 insert = this.env.contacts[id] + this.env.recipients_delimiter; 3600 3602 trigger = true; 3601 3603 } … … 3634 3636 // get string from current cursor pos to last comma 3635 3637 var cpos = this.get_caret_pos(this.ksearch_input), 3636 p = inp_value.lastIndexOf( ',', cpos-1),3638 p = inp_value.lastIndexOf(this.env.recipients_separator, cpos-1), 3637 3639 q = inp_value.substring(p+1, cpos), 3638 3640 min = this.env.autocomplete_min_length, -
branches/release-0.7/program/steps/addressbook/func.inc
r5350 r5402 620 620 } 621 621 $colprop['class'] .= ($colprop['class'] ? ' ' : '') . 'datepicker'; 622 $val = format_date($val, $RCMAIL->config->get('date_format', 'Y-m-d') );622 $val = format_date($val, $RCMAIL->config->get('date_format', 'Y-m-d'), false); 623 623 } 624 624 … … 729 729 { 730 730 global $RCMAIL; 731 return format_date($val, $RCMAIL->config->get('date_format', 'Y-m-d') );731 return format_date($val, $RCMAIL->config->get('date_format', 'Y-m-d'), false); 732 732 } 733 733 … … 759 759 // if _source is not specified we'll find it from decoded ID 760 760 if (!$got_source) { 761 list ($c, $s) = explode('-', $id, 2); 762 if (strlen($s)) { 763 $result[(string)$s][] = $c; 761 if ($sep = strrpos($id, '-')) { 762 $contact_id = substr($id, 0, $sep); 763 $source_id = substr($id, $sep+1); 764 if (strlen($source_id)) { 765 $result[(string)$source_id][] = $contact_id; 766 } 764 767 } 765 768 } -
branches/release-0.7/program/steps/mail/autocomplete.inc
r5328 r5402 33 33 } 34 34 35 $OUTPUT->command('replace_group_recipients', $gid, join(', ', $members)); 35 $separator = trim($RCMAIL->config->get('recipients_separator', ',')) . ' '; 36 $OUTPUT->command('replace_group_recipients', $gid, join($separator, array_unique($members))); 36 37 } 37 38 … … 71 72 continue; 72 73 } 73 // when we've got more than one book, we need toskip duplicates74 if ( $books_num == 1 ||!in_array($contact, $contacts)) {74 // skip duplicates 75 if (!in_array($contact, $contacts)) { 75 76 $contacts[] = $contact; 76 77 if (count($contacts) >= $MAXNUM) -
branches/release-0.7/program/steps/mail/compose.inc
r5297 r5402 6 6 | | 7 7 | This file is part of the Roundcube Webmail client | 8 | Copyright (C) 2005-20 09, The Roundcube Dev Team |8 | Copyright (C) 2005-2011, The Roundcube Dev Team | 9 9 | Licensed under the GNU GPL | 10 10 | | … … 123 123 // set current mailbox in client environment 124 124 $OUTPUT->set_env('mailbox', $IMAP->get_mailbox_name()); 125 $OUTPUT->set_env('sig_above', $CONFIG['sig_above']); 126 $OUTPUT->set_env('top_posting', $CONFIG['top_posting']); 125 $OUTPUT->set_env('sig_above', $RCMAIL->config->get('sig_above', false)); 126 $OUTPUT->set_env('top_posting', $RCMAIL->config->get('top_posting', false)); 127 $OUTPUT->set_env('recipients_separator', trim($RCMAIL->config->get('recipients_separator', ','))); 127 128 128 129 // get reference message and set compose mode … … 325 326 $a_recipients = array(); 326 327 $parts = array('to', 'cc', 'bcc', 'replyto', 'followupto'); 328 $separator = trim($RCMAIL->config->get('recipients_separator', ',')) . ' '; 327 329 328 330 foreach ($parts as $header) { … … 368 370 $fvalue .= $v; 369 371 if ($v = $MESSAGE->headers->cc) 370 $fvalue .= (!empty($fvalue) ? ', ': '') . $v;372 $fvalue .= (!empty($fvalue) ? $separator : '') . $v; 371 373 } 372 374 } … … 411 413 } 412 414 413 $fvalue = implode( ', ', $fvalue);415 $fvalue = implode($separator, $fvalue); 414 416 } 415 417 -
branches/release-0.7/program/steps/mail/func.inc
r5374 r5402 767 767 // previous line is flowed? 768 768 if (isset($body[$last]) && $body[$n] 769 && $last != $last_sig769 && $last !== $last_sig 770 770 && $body[$last][strlen($body[$last])-1] == ' ' 771 771 ) { -
branches/release-0.7/program/steps/mail/sendmail.inc
r5374 r5402 6 6 | | 7 7 | This file is part of the Roundcube Webmail client | 8 | Copyright (C) 2005-201 0, The Roundcube Dev Team |8 | Copyright (C) 2005-2011, The Roundcube Dev Team | 9 9 | Licensed under the GNU GPL | 10 10 | | … … 139 139 } 140 140 141 // parse email address input (and count addresses) 141 /** 142 * Parse and cleanup email address input (and count addresses) 143 * 144 * @param string Address input 145 * @param boolean Do count recipients (saved in global $RECIPIENT_COUNT) 146 * @param boolean Validate addresses (errors saved in global $EMAIL_FORMAT_ERROR) 147 * @return string Canonical recipients string separated by comma 148 */ 142 149 function rcmail_email_input_format($mailto, $count=false, $check=true) 143 150 { 144 global $ EMAIL_FORMAT_ERROR, $RECIPIENT_COUNT;151 global $RCMAIL, $EMAIL_FORMAT_ERROR, $RECIPIENT_COUNT; 145 152 146 153 // simplified email regexp, supporting quoted local part 147 154 $email_regexp = '(\S+|("[^"]+"))@\S+'; 148 155 149 $regexp = array('/[,;]\s*[\r\n]+/', '/[\r\n]+/', '/[,;]\s*$/m', '/;/', '/(\S{1})(<'.$email_regexp.'>)/U'); 150 $replace = array(', ', ', ', '', ',', '\\1 \\2'); 156 $delim = trim($RCMAIL->config->get('recipients_separator', ',')); 157 $regexp = array("/[,;$delim]\s*[\r\n]+/", '/[\r\n]+/', "/[,;$delim]\s*\$/m", '/;/', '/(\S{1})(<'.$email_regexp.'>)/U'); 158 $replace = array($delim.' ', ', ', '', $delim, '\\1 \\2'); 151 159 152 160 // replace new lines and strip ending ', ', make address input more valid … … 154 162 155 163 $result = array(); 156 $items = rcube_explode_quoted_string( ',', $mailto);164 $items = rcube_explode_quoted_string($delim, $mailto); 157 165 158 166 foreach($items as $item) { … … 169 177 } else if (preg_match('/<*'.$email_regexp.'>*$/', $item, $matches)) { 170 178 $address = $matches[0]; 171 $name = str_replace($address, '', $item); 172 $name = trim($name); 173 if ($name && ($name[0] != '"' || $name[strlen($name)-1] != '"') 174 && preg_match('/[\(\)\<\>\\\.\[\]@,;:"]/', $name)) { 175 $name = '"'.addcslashes($name, '"').'"'; 176 } 179 $name = trim(str_replace($address, '', $item), '" '); 177 180 $address = rcube_idn_to_ascii(trim($address, '<>')); 178 $address = '<' . $address . '>'; 179 180 $result[] = $name.' '.$address; 181 $result[] = format_email_recipient($address, $name); 181 182 $item = $address; 182 183 } else if (trim($item)) { -
branches/release-0.7/program/steps/settings/edit_folder.inc
r5306 r5402 120 120 'maxlength' => 150, 121 121 'unsubscribed' => true, 122 'exceptions' => array($mbox_imap), 122 'skip_noinferiors' => true, 123 'exceptions' => array($mbox_imap), 123 124 )); 124 125 -
branches/release-0.7/program/steps/settings/folders.inc
r5309 r5402 284 284 285 285 if (!$protected) { 286 $ opts = $IMAP->mailbox_options($folder['id']);287 $noselect = in_array('\\Noselect', $ opts);286 $attrs = $IMAP->mailbox_attributes($folder['id']); 287 $noselect = in_array('\\Noselect', $attrs); 288 288 } 289 289
Note: See TracChangeset
for help on using the changeset viewer.
