Ah, I see - the stuff after the ? needs to be handed to src/compose.php as-is, no...
authorpdontthink <pdontthink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Fri, 9 Jan 2015 06:10:11 +0000 (06:10 +0000)
committerpdontthink <pdontthink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Fri, 9 Jan 2015 06:10:11 +0000 (06:10 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@14490 7612ce4b-ef26-0410-bec9-ea0150e637f0

plugins/listcommands/functions.php

index 5e71da5c7a1d818f69d217ce303369eed212de09..6c526c2a49ff4e72a6aa03293cb85ca8dea6bd07 100644 (file)
@@ -84,6 +84,7 @@ function plugin_listcommands_menu_do() {
 
         /* proto = {mailto,href} */
         $aActions = array_keys($actions);
+        // note that we only use the first cmd/action, ignore the rest
         $proto = array_shift($aActions);
         $act   = array_shift($actions);
 
@@ -95,7 +96,17 @@ function plugin_listcommands_menu_do() {
             } else {
                 $url = "plugins/listcommands/mailout.php?action=$cmd&amp;";
             }
-            $url .= 'send_to=' . urlencode($act);
+
+            // if things like subject are given, peel them off and give
+            // them to src/compose.php as is (not encoded)
+            if (strpos($act, '?') > 0) {
+               list($act, $parameters) = explode('?', $act, 2);
+               $parameters = '&amp;' . $parameters;
+            } else {
+               $parameters = '';
+            }
+
+            $url .= 'send_to=' . urlencode($act) . $parameters;
 
             $links[$cmd] = makeComposeLink($url, $fieldsdescr[$cmd]);