Ticket #1484313 (closed Patches: fixed)
Mailbox name not quoted when used in URL - patch available
| Reported by: | Emil Wojak | Owned by: | thomasb |
|---|---|---|---|
| Priority: | 2 | Milestone: | 0.1.1 |
| Component: | Core functionality | Version: | svn-trunk |
| Severity: | major | Keywords: | |
| Cc: |
Description
Whenever a mailbox's name has some non-ASCII characters encoded in UTF-7, it then contains an ampersand, which should be encoded each time it's used in URL. There are some variables both in PHP and JS code, that are used literally, which causes some failures when dealing with such mailboxes.
In particular, you can't fetch attachments.
So here's the resolution:
Index: program/js/app.js
===================================================================
--- program/js/app.js (wersja 536)
+++ program/js/app.js (kopia robocza)
@@ -668,7 +668,7 @@
break;
case 'load-attachment':
- var qstring = '_mbox='+this.env.mailbox+'&_uid='+this.env.uid+'&_part='+props.part;
+ var qstring = '_mbox='+urlencode(this.env.mailbox)+'&_uid='+this.env.uid+'&_part='+props.part;
// open attachment in frame if it's of a supported mimetype
if (this.env.uid && props.mimetype && find_in_array(props.mimetype, this.mimetypes)>=0)
@@ -1948,7 +1948,7 @@
{
this.message_list.clear();
this.set_busy(true, 'searching');
- this.http_request('search', '_search='+value+'&_mbox='+mbox, true);
+ this.http_request('search', '_search='+value+'&_mbox='+urlencode(mbox), true);
}
return true;
};
Index: program/steps/mail/func.inc
===================================================================
--- program/steps/mail/func.inc (wersja 536)
+++ program/steps/mail/func.inc (kopia robocza)
@@ -59,7 +59,7 @@
// define url for getting message parts
if (strlen($_GET['_uid']))
- $GET_URL = sprintf('%s&_action=get&_mbox=%s&_uid=%d', $COMM_PATH, $IMAP->get_mailbox_name(), get_input_value('_uid', RCUBE_INPUT_GET));
+ $GET_URL = sprintf('%s&_action=get&_mbox=%s&_uid=%d', $COMM_PATH, urlencode($IMAP->get_mailbox_name()), get_input_value('_uid', RCUBE_INPUT_GET));
// set current mailbox in client environment
Attachments
Change History
Note: See
TracTickets for help on using
tickets.
