Changeset b72e2f9 in github


Ignore:
Timestamp:
Nov 12, 2010 8:05:18 AM (3 years ago)
Author:
alecpl <alec@…>
Branches:
master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.6, release-0.7, release-0.8
Children:
5d23891
Parents:
74cd6cce
Message:
  • Fix handling of folders with "<>" characters in name
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • CHANGELOG

    r310fc2d rb72e2f9  
    6868- Add support for shared folders (#1403507) 
    6969- Fix handling of folders with name "0" (#1487119) 
     70- Fix handling of folders with "<>" characters in name 
    7071- jQuery 1.4.4 
    7172 
  • program/include/main.inc

    r4484097 rb72e2f9  
    540540    if (!$html_encode_arr) 
    541541      { 
    542       $html_encode_arr = get_html_translation_table(HTML_SPECIALCHARS);         
     542      $html_encode_arr = get_html_translation_table(HTML_SPECIALCHARS); 
    543543      unset($html_encode_arr['?']); 
    544544      } 
  • program/steps/mail/copy.inc

    rac2c953 rb72e2f9  
    2727if (!empty($_POST['_uid']) && !empty($_POST['_target_mbox'])) { 
    2828    $uids = get_input_value('_uid', RCUBE_INPUT_POST); 
    29     $target = get_input_value('_target_mbox', RCUBE_INPUT_POST); 
    30     $mbox = get_input_value('_mbox', RCUBE_INPUT_POST); 
     29    $target = get_input_value('_target_mbox', RCUBE_INPUT_POST, true); 
     30    $mbox = get_input_value('_mbox', RCUBE_INPUT_POST, true); 
    3131 
    3232    $copied = $IMAP->copy_message($uids, $target, $mbox); 
  • program/steps/mail/folders.inc

    re019f2d rb72e2f9  
    2323  return; 
    2424 
    25 $mbox_name = $IMAP->get_mailbox_name(); 
     25$mbox = get_input_value('_mbox', RCUBE_INPUT_POST, true); 
    2626 
    2727// send EXPUNGE command 
    28 if ($RCMAIL->action=='expunge' && ($mbox = get_input_value('_mbox', RCUBE_INPUT_POST))) 
     28if ($RCMAIL->action=='expunge') 
    2929{ 
    3030  $success = $IMAP->expunge($mbox); 
    3131 
    32   // reload message list if current mailbox   
     32  // reload message list if current mailbox 
    3333  if ($success && !empty($_REQUEST['_reload'])) 
    3434  { 
     
    4343 
    4444// clear mailbox 
    45 else if ($RCMAIL->action=='purge' && ($mbox = get_input_value('_mbox', RCUBE_INPUT_POST))) 
     45else if ($RCMAIL->action=='purge') 
    4646{ 
    4747  $delimiter = $IMAP->get_hierarchy_delimiter(); 
    4848  $trash_regexp = '/^' . preg_quote($CONFIG['trash_mbox'] . $delimiter, '/') . '/'; 
    49   $junk_regexp = '/^' . preg_quote($CONFIG['junk_mbox'] . $delimiter, '/') . '/';                      
     49  $junk_regexp = '/^' . preg_quote($CONFIG['junk_mbox'] . $delimiter, '/') . '/'; 
    5050 
    5151  // we should only be purging trash and junk (or their subfolders) 
     
    6161      $OUTPUT->command('message_list.clear'); 
    6262      $OUTPUT->command('set_rowcount', rcmail_get_messagecount_text()); 
    63       $OUTPUT->command('set_unread_count', $mbox_name, 0); 
     63      $OUTPUT->command('set_unread_count', $mbox, 0); 
    6464      $OUTPUT->command('set_quota', rcmail_quota_content()); 
    65       $_SESSION['unseen_count'][$mbox_name] = 0; 
     65      $_SESSION['unseen_count'][$mbox] = 0; 
    6666    } 
    6767    else 
  • program/steps/mail/func.inc

    r4484097 rb72e2f9  
    4747 
    4848// set imap properties and session vars 
    49 if (strlen(trim($mbox = get_input_value('_mbox', RCUBE_INPUT_GPC)))) 
     49if (strlen(trim($mbox = get_input_value('_mbox', RCUBE_INPUT_GPC, true)))) 
    5050  $IMAP->set_mailbox(($_SESSION['mbox'] = $mbox)); 
    5151else if ($IMAP) 
  • program/steps/mail/move_del.inc

    r4484097 rb72e2f9  
    3131if ($RCMAIL->action=='moveto' && !empty($_POST['_uid']) && strlen($_POST['_target_mbox'])) { 
    3232    $count = sizeof(explode(',', ($uids = get_input_value('_uid', RCUBE_INPUT_POST)))); 
    33     $target = get_input_value('_target_mbox', RCUBE_INPUT_POST); 
    34     $mbox = get_input_value('_mbox', RCUBE_INPUT_POST); 
     33    $target = get_input_value('_target_mbox', RCUBE_INPUT_POST, true); 
     34    $mbox = get_input_value('_mbox', RCUBE_INPUT_POST, true); 
    3535 
    3636    $moved = $IMAP->move_message($uids, $target, $mbox); 
     
    5353else if ($RCMAIL->action=='delete' && !empty($_POST['_uid'])) { 
    5454    $count = sizeof(explode(',', ($uids = get_input_value('_uid', RCUBE_INPUT_POST)))); 
    55     $mbox = get_input_value('_mbox', RCUBE_INPUT_POST); 
     55    $mbox = get_input_value('_mbox', RCUBE_INPUT_POST, true); 
    5656 
    5757    $del = $IMAP->delete_message($uids, $mbox); 
  • program/steps/settings/manage_folders.inc

    r4484097 rb72e2f9  
    2828if ($RCMAIL->action=='subscribe') 
    2929  { 
    30   $mbox = get_input_value('_mbox', RCUBE_INPUT_POST, false, 'UTF7-IMAP'); 
     30  $mbox = get_input_value('_mbox', RCUBE_INPUT_POST, true, 'UTF7-IMAP'); 
    3131  if (strlen($mbox)) 
    3232    $IMAP->subscribe(array($mbox)); 
     
    3636else if ($RCMAIL->action=='unsubscribe') 
    3737  { 
    38   $mbox = get_input_value('_mbox', RCUBE_INPUT_POST, false, 'UTF7-IMAP'); 
     38  $mbox = get_input_value('_mbox', RCUBE_INPUT_POST, true, 'UTF7-IMAP'); 
    3939  if (strlen($mbox)) 
    4040    $IMAP->unsubscribe(array($mbox)); 
     
    4444else if ($RCMAIL->action=='enable-threading') 
    4545  { 
    46   $mbox = get_input_value('_mbox', RCUBE_INPUT_POST, false, 'UTF7-IMAP'); 
     46  $mbox = get_input_value('_mbox', RCUBE_INPUT_POST, true, 'UTF7-IMAP'); 
    4747  if (strlen($mbox)) 
    4848    rcube_set_threading($mbox, true); 
     
    5252else if ($RCMAIL->action=='disable-threading') 
    5353  { 
    54   $mbox = get_input_value('_mbox', RCUBE_INPUT_POST, false, 'UTF7-IMAP'); 
     54  $mbox = get_input_value('_mbox', RCUBE_INPUT_POST, true, 'UTF7-IMAP'); 
    5555  if (strlen($mbox)) 
    5656    rcube_set_threading($mbox, false); 
     
    6262  if (strlen(trim($_POST['_name']))) 
    6363    { 
    64     $name = trim(get_input_value('_name', RCUBE_INPUT_POST, FALSE, 'UTF7-IMAP')); 
     64    $name = trim(get_input_value('_name', RCUBE_INPUT_POST, true, 'UTF7-IMAP')); 
    6565    $create = $IMAP->create_mailbox($name, TRUE); 
    6666    } 
     
    7272    $index = array_search($create, $folderlist); 
    7373    $before = $index !== false && isset($folderlist[$index+1]) ? rcube_charset_convert($folderlist[$index+1], 'UTF7-IMAP') : false; 
    74      
     74 
    7575    $create = rcube_charset_convert($create, 'UTF7-IMAP'); 
    7676    $foldersplit = explode($delimiter, $create); 
    77     $display_create = str_repeat('&nbsp;&nbsp;&nbsp;&nbsp;', substr_count($create, $delimiter)) . $foldersplit[count($foldersplit)-1]; 
     77    $display_create = str_repeat('&nbsp;&nbsp;&nbsp;&nbsp;', substr_count($create, $delimiter)) 
     78        . Q($foldersplit[count($foldersplit)-1]); 
    7879 
    7980    $OUTPUT->command('add_folder_row', $create, $display_create, false, $before); 
     
    9091  if (strlen(trim($_POST['_folder_oldname'])) && strlen(trim($_POST['_folder_newname']))) 
    9192    { 
    92     $name_utf8 = trim(get_input_value('_folder_newname', RCUBE_INPUT_POST)); 
    93     $oldname_utf8 = get_input_value('_folder_oldname', RCUBE_INPUT_POST); 
     93    $name_utf8 = trim(get_input_value('_folder_newname', RCUBE_INPUT_POST, true)); 
     94    $oldname_utf8 = get_input_value('_folder_oldname', RCUBE_INPUT_POST, true); 
    9495    $name = rcube_charset_convert($name_utf8, RCMAIL_CHARSET, 'UTF7-IMAP'); 
    9596    $oldname = rcube_charset_convert($oldname_utf8, RCMAIL_CHARSET, 'UTF7-IMAP'); 
     
    131132        $foldersplit = explode($delimiter, $folderlist[$x]); 
    132133        $level = count($foldersplit) - 1; 
    133         $display_rename = str_repeat('&nbsp;&nbsp;&nbsp;&nbsp;', $level)  
    134           . rcube_charset_convert($foldersplit[$level], 'UTF7-IMAP'); 
     134        $display_rename = str_repeat('&nbsp;&nbsp;&nbsp;&nbsp;', $level) 
     135          . Q(rcube_charset_convert($foldersplit[$level], 'UTF7-IMAP')); 
    135136 
    136137        $before = isset($folderlist[$x+1]) ? rcube_charset_convert($folderlist[$x+1], 'UTF7-IMAP') : false; 
     
    143144    $foldersplit = explode($delimiter, $rename); 
    144145    $level = count($foldersplit) - 1; 
    145     $display_rename = str_repeat('&nbsp;&nbsp;&nbsp;&nbsp;', $level) . rcube_charset_convert($foldersplit[$level], 'UTF7-IMAP'); 
     146    $display_rename = str_repeat('&nbsp;&nbsp;&nbsp;&nbsp;', $level) . Q(rcube_charset_convert($foldersplit[$level], 'UTF7-IMAP')); 
    146147    $index = array_search($rename, $folderlist); 
    147148    $before = $index !== false && isset($folderlist[$index+1]) ? rcube_charset_convert($folderlist[$index+1], 'UTF7-IMAP') : false; 
     
    165166  $delimiter = $IMAP->get_hierarchy_delimiter(); 
    166167   
    167   $mboxes_utf8 = get_input_value('_mboxes', RCUBE_INPUT_POST); 
     168  $mboxes_utf8 = get_input_value('_mboxes', RCUBE_INPUT_POST, true); 
    168169  $mboxes = rcube_charset_convert($mboxes_utf8, RCMAIL_CHARSET, 'UTF7-IMAP'); 
    169170 
     
    288289    $protected = ($CONFIG['protect_default_folders'] == true && in_array($folder['id'], $CONFIG['default_imap_folders'])); 
    289290    $classes = array($i%2 ? 'even' : 'odd'); 
    290     $folder_js = JQ($folder['id']); 
     291    $folder_js = Q($folder['id']); 
    291292    $display_folder = str_repeat('&nbsp;&nbsp;&nbsp;&nbsp;', $folder['level']) . Q($protected ? rcmail_localize_foldername($folder['id']) : $folder['name']); 
    292293    $folder_utf8 = rcube_charset_convert($folder['id'], 'UTF7-IMAP'); 
     
    322323    } 
    323324     
    324     $a_js_folders['rcmrow'.$idx] = array($folder_utf8, $display_folder, $protected || $folder['virtual']); 
     325    $a_js_folders['rcmrow'.$idx] = array($folder_utf8, Q($display_folder), $protected || $folder['virtual']); 
    325326  } 
    326327 
Note: See TracChangeset for help on using the changeset viewer.