[Svn] r4711 - in trunk/roundcubemail: . program/js program/steps/addressbook

trac at roundcube.net trac at roundcube.net
Fri Apr 29 20:36:40 CEST 2011


Author: alec
Date: 2011-04-29 13:36:40 -0500 (Fri, 29 Apr 2011)
New Revision: 4711

Modified:
   trunk/roundcubemail/CHANGELOG
   trunk/roundcubemail/program/js/app.js
   trunk/roundcubemail/program/steps/addressbook/mailto.inc
Log:
- Fix a bug where selecting too many contacts would produce too large URI request (#1487892)


Modified: trunk/roundcubemail/CHANGELOG
===================================================================
--- trunk/roundcubemail/CHANGELOG	2011-04-29 08:17:42 UTC (rev 4710)
+++ trunk/roundcubemail/CHANGELOG	2011-04-29 18:36:40 UTC (rev 4711)
@@ -1,6 +1,7 @@
 CHANGELOG Roundcube Webmail
 ===========================
 
+- Fix a bug where selecting too many contacts would produce too large URI request (#1487892)
 - Fix relative URLs handling according to a <base> in HTML (#1487889)
 - Fix handling of top-level domains with more than 5 chars or unicode chars (#1487883)
 - Fix usage of non-standard HTTP error codes (#1487797)

Modified: trunk/roundcubemail/program/js/app.js
===================================================================
--- trunk/roundcubemail/program/js/app.js	2011-04-29 08:17:42 UTC (rev 4710)
+++ trunk/roundcubemail/program/js/app.js	2011-04-29 18:36:40 UTC (rev 4711)
@@ -808,10 +808,10 @@
       case 'compose':
         var url = this.env.comm_path+'&_action=compose';
 
-        if (this.task=='mail') {
+        if (this.task == 'mail') {
           url += '&_mbox='+urlencode(this.env.mailbox);
 
-          if (this.env.mailbox==this.env.drafts_mailbox) {
+          if (this.env.mailbox == this.env.drafts_mailbox) {
             var uid;
             if (uid = this.get_single_uid())
               url += '&_draft_uid='+uid;
@@ -820,7 +820,7 @@
              url += '&_to='+urlencode(props);
         }
         // modify url if we're in addressbook
-        else if (this.task=='addressbook') {
+        else if (this.task == 'addressbook') {
           // switch to mail compose step directly
           if (props && props.indexOf('@') > 0) {
             url = this.get_task_url('mail', url);
@@ -829,25 +829,22 @@
           }
 
           // use contact_id passed as command parameter
-          var a_cids = [];
+          var n, len, a_cids = [];
           if (props)
             a_cids.push(props);
           // get selected contacts
           else if (this.contact_list) {
             var selection = this.contact_list.get_selection();
-            for (var n=0; n<selection.length; n++)
+            for (n=0, len=selection.length; n<len; n++)
               a_cids.push(selection[n]);
           }
 
           if (a_cids.length)
-            this.http_request('mailto', '_cid='+urlencode(a_cids.join(','))+'&_source='+urlencode(this.env.source), true);
+            this.http_post('mailto', {_cid: a_cids.join(','), _source: this.env.source}, true);
 
           break;
         }
 
-        // don't know if this is necessary...
-        url = url.replace(/&_framed=1/, '');
-
         this.redirect(url);
         break;
 

Modified: trunk/roundcubemail/program/steps/addressbook/mailto.inc
===================================================================
--- trunk/roundcubemail/program/steps/addressbook/mailto.inc	2011-04-29 08:17:42 UTC (rev 4710)
+++ trunk/roundcubemail/program/steps/addressbook/mailto.inc	2011-04-29 18:36:40 UTC (rev 4711)
@@ -19,14 +19,14 @@
 
 */
 
-$cid = get_input_value('_cid', RCUBE_INPUT_GET);
+$cid = get_input_value('_cid', RCUBE_INPUT_POST);
 $recipients = null;
 $mailto = array();
 
 if ($cid && preg_match('/^[a-z0-9\+\/=_-]+(,[a-z0-9\+\/=_-]+)*$/i', $cid) && $CONTACTS->ready)
 {
   $CONTACTS->set_page(1);
-  $CONTACTS->set_pagesize(100);
+  $CONTACTS->set_pagesize(substr_count($cid, ',')+2); // +2 to skip counting query
   $recipients = $CONTACTS->search($CONTACTS->primary_key, $cid);
 
   while (is_object($recipients) && ($rec = $recipients->iterate())) {

_______________________________________________
http://lists.roundcube.net/mailman/listinfo/svn



More information about the Svn mailing list