Changeset 4484097 in github
- Timestamp:
- Nov 12, 2010 5:47:04 AM (3 years ago)
- Branches:
- master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.6, release-0.7, release-0.8
- Children:
- 310fc2d
- Parents:
- d2b27d1
- Files:
-
- 9 edited
-
CHANGELOG (modified) (1 diff)
-
program/include/html.php (modified) (1 diff)
-
program/include/main.inc (modified) (2 diffs)
-
program/include/rcmail.php (modified) (1 diff)
-
program/include/rcube_imap.php (modified) (11 diffs)
-
program/include/rcube_imap_generic.php (modified) (6 diffs)
-
program/steps/mail/func.inc (modified) (1 diff)
-
program/steps/mail/move_del.inc (modified) (2 diffs)
-
program/steps/settings/manage_folders.inc (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
CHANGELOG
r00290a6 r4484097 67 67 - Fix operations on messages in unsubscribed folder (#1487107) 68 68 - Add support for shared folders (#1403507) 69 - Fix handling of folders with name "0" (#1487119) 69 70 70 71 RELEASE 0.4.2 -
program/include/html.php
r5c461ba r4484097 76 76 77 77 $tagname = self::$lc_tags ? strtolower($tagname) : $tagname; 78 if ( $content|| in_array($tagname, self::$containers)) {78 if (isset($content) || in_array($tagname, self::$containers)) { 79 79 $templ = $attrib['noclose'] ? "<%s%s>%s" : "<%s%s>%s</%s>%s"; 80 80 unset($attrib['noclose']); -
program/include/main.inc
rd2b27d1 r4484097 1349 1349 1350 1350 // sometimes folder has a delimiter as the last character 1351 if ( empty($subFolders))1351 if (!strlen($subFolders)) 1352 1352 $virtual = false; 1353 1353 else if (!isset($arrFolders[$currentFolder])) … … 1379 1379 $arrFolders[$currentFolder]['virtual'] = $virtual; 1380 1380 1381 if ( !empty($subFolders))1381 if (strlen($subFolders)) 1382 1382 rcmail_build_folder_tree($arrFolders[$currentFolder]['folders'], $subFolders, $delm, $path.$delm); 1383 1383 } -
program/include/rcmail.php
r00290a6 r4484097 783 783 $this->imap->set_default_mailboxes($default_folders); 784 784 } 785 if ( !empty($_SESSION['mbox'])) {785 if (isset($_SESSION['mbox'])) { 786 786 $this->imap->set_mailbox($_SESSION['mbox']); 787 787 } -
program/include/rcube_imap.php
rad58811 r4484097 566 566 function messagecount($mbox_name='', $mode='ALL', $force=false, $status=true) 567 567 { 568 $mailbox = $mbox_name? $this->mod_mailbox($mbox_name) : $this->mailbox;568 $mailbox = strlen($mbox_name) ? $this->mod_mailbox($mbox_name) : $this->mailbox; 569 569 return $this->_messagecount($mailbox, $mode, $force, $status); 570 570 } … … 587 587 $mode = strtoupper($mode); 588 588 589 if ( empty($mailbox))589 if (!strlen($mailbox)) 590 590 $mailbox = $this->mailbox; 591 591 … … 2552 2552 $tbox = $to_mbox; 2553 2553 $to_mbox = $this->mod_mailbox($to_mbox); 2554 $from_mbox = $from_mbox? $this->mod_mailbox($from_mbox) : $this->mailbox;2554 $from_mbox = strlen($from_mbox) ? $this->mod_mailbox($from_mbox) : $this->mailbox; 2555 2555 2556 2556 list($uids, $all_mode) = $this->_parse_uids($uids, $from_mbox); … … 2722 2722 function clear_mailbox($mbox_name=NULL) 2723 2723 { 2724 $mailbox = !empty($mbox_name) ? $this->mod_mailbox($mbox_name) : $this->mailbox;2724 $mailbox = strlen($mbox_name) ? $this->mod_mailbox($mbox_name) : $this->mailbox; 2725 2725 2726 2726 // SELECT will set messages count for clearFolder() … … 2875 2875 2876 2876 foreach ($a_mboxes as $idx => $mbox_row) { 2877 if ( $name = $this->mod_mailbox($mbox_row, 'out'))2877 if (strlen($name = $this->mod_mailbox($mbox_row, 'out'))) 2878 2878 $a_out[] = $name; 2879 2879 unset($a_mboxes[$idx]); … … 2979 2979 // modify names with root dir 2980 2980 foreach ($a_mboxes as $idx => $mbox_name) { 2981 if ( $name = $this->mod_mailbox($mbox_name, 'out'))2981 if (strlen($name = $this->mod_mailbox($mbox_name, 'out'))) 2982 2982 $a_folders[] = $name; 2983 2983 unset($a_mboxes[$idx]); … … 3195 3195 function mailbox_exists($mbox_name, $subscription=false) 3196 3196 { 3197 if ($mbox_name) { 3198 if ($mbox_name == 'INBOX') 3199 return true; 3200 3201 $key = $subscription ? 'subscribed' : 'existing'; 3202 $mbox = $this->mod_mailbox($mbox_name); 3203 3204 if (is_array($this->icache[$key]) && in_array($mbox, $this->icache[$key])) 3205 return true; 3206 3207 if ($subscription) { 3208 $a_folders = $this->conn->listSubscribed('', $mbox); 3209 } 3210 else { 3211 $a_folders = $this->conn->listMailboxes('', $mbox); 3212 } 3213 3214 if (is_array($a_folders) && in_array($mbox, $a_folders)) { 3215 $this->icache[$key][] = $mbox; 3216 return true; 3217 } 3197 if ($mbox_name == 'INBOX') 3198 return true; 3199 3200 $key = $subscription ? 'subscribed' : 'existing'; 3201 $mbox = $this->mod_mailbox($mbox_name); 3202 3203 if (is_array($this->icache[$key]) && in_array($mbox, $this->icache[$key])) 3204 return true; 3205 3206 if ($subscription) { 3207 $a_folders = $this->conn->listSubscribed('', $mbox); 3208 } 3209 else { 3210 $a_folders = $this->conn->listMailboxes('', $mbox); 3211 } 3212 3213 if (is_array($a_folders) && in_array($mbox, $a_folders)) { 3214 $this->icache[$key][] = $mbox; 3215 return true; 3218 3216 } 3219 3217 … … 3231 3229 function mod_mailbox($mbox_name, $mode='in') 3232 3230 { 3233 if ( empty($mbox_name))3231 if (!strlen($mbox_name)) 3234 3232 return ''; 3235 3233 … … 3461 3459 $mailbox = $this->mod_mailbox($mailbox); 3462 3460 3463 if ($this->get_capability('METADATA') || 3464 empty($mailbox) && $this->get_capability('METADATA-SERVER')3461 if ($this->get_capability('METADATA') || 3462 (!strlen($mailbox) && $this->get_capability('METADATA-SERVER')) 3465 3463 ) { 3466 3464 return $this->conn->setMetadata($mailbox, $entries); … … 3495 3493 3496 3494 if ($this->get_capability('METADATA') || 3497 empty($mailbox) && $this->get_capability('METADATA-SERVER')3495 (!strlen($mailbox) && $this->get_capability('METADATA-SERVER')) 3498 3496 ) { 3499 3497 return $this->conn->deleteMetadata($mailbox, $entries); … … 3529 3527 3530 3528 if ($this->get_capability('METADATA') || 3531 empty($mailbox) && $this->get_capability('METADATA-SERVER')3529 !strlen(($mailbox) && $this->get_capability('METADATA-SERVER')) 3532 3530 ) { 3533 3531 return $this->conn->getMetadata($mailbox, $entries, $options); -
program/include/rcube_imap_generic.php
rad3c273 r4484097 802 802 function select($mailbox) 803 803 { 804 if ( empty($mailbox)) {804 if (!strlen($mailbox)) { 805 805 return false; 806 806 } … … 853 853 function status($mailbox, $items=array()) 854 854 { 855 if ( empty($mailbox)) {855 if (!strlen($mailbox)) { 856 856 return false; 857 857 } … … 887 887 function checkForRecent($mailbox) 888 888 { 889 if ( empty($mailbox)) {889 if (!strlen($mailbox)) { 890 890 $mailbox = 'INBOX'; 891 891 } 892 892 893 893 $this->select($mailbox); 894 894 895 if ($this->selected == $mailbox) { 895 896 return $this->data['RECENT']; … … 1619 1620 function copy($messages, $from, $to) 1620 1621 { 1621 if (empty($from) || empty($to)) {1622 return false;1623 }1624 1625 1622 if (!$this->select($from)) { 1626 1623 return false; … … 1639 1636 function move($messages, $from, $to) 1640 1637 { 1641 if (!$from || !$to) {1642 return false;1643 }1644 1645 1638 $r = $this->copy($messages, $from, $to); 1646 1639 … … 1882 1875 $status_opts=array(), $select_opts=array()) 1883 1876 { 1884 if ( empty($mailbox)) {1877 if (!strlen($mailbox)) { 1885 1878 $mailbox = '*'; 1886 1879 } -
program/steps/mail/func.inc
rcb105aa r4484097 47 47 48 48 // set imap properties and session vars 49 if ( $mbox = get_input_value('_mbox', RCUBE_INPUT_GPC))49 if (strlen(trim($mbox = get_input_value('_mbox', RCUBE_INPUT_GPC)))) 50 50 $IMAP->set_mailbox(($_SESSION['mbox'] = $mbox)); 51 51 else if ($IMAP) -
program/steps/mail/move_del.inc
rc50d887 r4484097 29 29 30 30 // move messages 31 if ($RCMAIL->action=='moveto' && !empty($_POST['_uid']) && !empty($_POST['_target_mbox'])) {31 if ($RCMAIL->action=='moveto' && !empty($_POST['_uid']) && strlen($_POST['_target_mbox'])) { 32 32 $count = sizeof(explode(',', ($uids = get_input_value('_uid', RCUBE_INPUT_POST)))); 33 33 $target = get_input_value('_target_mbox', RCUBE_INPUT_POST); … … 117 117 } 118 118 119 if ($RCMAIL->action=='moveto' && $target) {119 if ($RCMAIL->action=='moveto' && strlen($target)) { 120 120 rcmail_send_unread_count($target, true); 121 121 } -
program/steps/settings/manage_folders.inc
r36ed9d7 r4484097 28 28 if ($RCMAIL->action=='subscribe') 29 29 { 30 if ($mbox = get_input_value('_mbox', RCUBE_INPUT_POST, false, 'UTF7-IMAP')) 30 $mbox = get_input_value('_mbox', RCUBE_INPUT_POST, false, 'UTF7-IMAP'); 31 if (strlen($mbox)) 31 32 $IMAP->subscribe(array($mbox)); 32 33 } … … 35 36 else if ($RCMAIL->action=='unsubscribe') 36 37 { 37 if ($mbox = get_input_value('_mbox', RCUBE_INPUT_POST, false, 'UTF7-IMAP')) 38 $mbox = get_input_value('_mbox', RCUBE_INPUT_POST, false, 'UTF7-IMAP'); 39 if (strlen($mbox)) 38 40 $IMAP->unsubscribe(array($mbox)); 39 41 } … … 42 44 else if ($RCMAIL->action=='enable-threading') 43 45 { 44 if ($mbox = get_input_value('_mbox', RCUBE_INPUT_POST, false, 'UTF7-IMAP')) 46 $mbox = get_input_value('_mbox', RCUBE_INPUT_POST, false, 'UTF7-IMAP'); 47 if (strlen($mbox)) 45 48 rcube_set_threading($mbox, true); 46 49 } … … 49 52 else if ($RCMAIL->action=='disable-threading') 50 53 { 51 if ($mbox = get_input_value('_mbox', RCUBE_INPUT_POST, false, 'UTF7-IMAP')) 54 $mbox = get_input_value('_mbox', RCUBE_INPUT_POST, false, 'UTF7-IMAP'); 55 if (strlen($mbox)) 52 56 rcube_set_threading($mbox, false); 53 57 } … … 56 60 else if ($RCMAIL->action=='create-folder') 57 61 { 58 if ( !empty($_POST['_name']))62 if (strlen(trim($_POST['_name']))) 59 63 { 60 64 $name = trim(get_input_value('_name', RCUBE_INPUT_POST, FALSE, 'UTF7-IMAP')); … … 84 88 else if ($RCMAIL->action=='rename-folder') 85 89 { 86 if ( !empty($_POST['_folder_oldname']) && !empty($_POST['_folder_newname']))90 if (strlen(trim($_POST['_folder_oldname'])) && strlen(trim($_POST['_folder_newname']))) 87 91 { 88 92 $name_utf8 = trim(get_input_value('_folder_newname', RCUBE_INPUT_POST)); … … 102 106 if ($key == $oldname) { 103 107 unset($a_threaded[$key]); 104 $a_threaded[$name] = true;108 $a_threaded[$name] = true; 105 109 } 106 110 else if (preg_match($oldprefix, $key)) { 107 111 unset($a_threaded[$key]); 108 $a_threaded[preg_replace($oldprefix, $name.$delimiter, $key)] = true;112 $a_threaded[preg_replace($oldprefix, $name.$delimiter, $key)] = true; 109 113 } 110 114 111 115 $RCMAIL->user->save_prefs(array('message_threading' => $a_threaded)); 112 116 } … … 164 168 $mboxes = rcube_charset_convert($mboxes_utf8, RCMAIL_CHARSET, 'UTF7-IMAP'); 165 169 166 if ( $mboxes)170 if (strlen($mboxes)) 167 171 $deleted = $IMAP->delete_mailbox(array($mboxes)); 168 172 … … 285 289 $classes = array($i%2 ? 'even' : 'odd'); 286 290 $folder_js = JQ($folder['id']); 287 $display_folder = str_repeat(' ', $folder['level']) . ($protected ? rcmail_localize_foldername($folder['id']) : $folder['name']);291 $display_folder = str_repeat(' ', $folder['level']) . Q($protected ? rcmail_localize_foldername($folder['id']) : $folder['name']); 288 292 $folder_utf8 = rcube_charset_convert($folder['id'], 'UTF7-IMAP'); 289 293 … … 299 303 $table->add_row(array('id' => 'rcmrow'.$idx, 'class' => join(' ', $classes))); 300 304 301 $table->add('name', Q($display_folder));305 $table->add('name', $display_folder); 302 306 $table->add('msgcount', (($folder['virtual'] || $noselect) ? '' : $IMAP->messagecount($folder['id'], 'ALL', false, false))); 303 307 $table->add('subscribed', $checkbox_subscribe->show(($subscribed ? $folder_utf8 : ''), … … 321 325 } 322 326 323 rcmail::get_instance()->plugins->exec_hook('folders_list', array('table' =>$table));327 rcmail::get_instance()->plugins->exec_hook('folders_list', array('table' => $table)); 324 328 325 329 $OUTPUT->add_gui_object('subscriptionlist', $attrib['id']);
Note: See TracChangeset
for help on using the changeset viewer.
