[prev in list] [next in list] [prev in thread] [next in thread] 

List:       squirrelmail-cvs
Subject:    [SM-CVS] SF.net SVN: squirrelmail:[13885] trunk/squirrelmail
From:       jangliss () users ! sourceforge ! net
Date:       2010-01-19 3:17:15
Message-ID: E1NX4ah-00064N-0v () dn4whf1 ! ch3 ! sourceforge ! com
[Download RAW message or body]

Revision: 13885
          http://squirrelmail.svn.sourceforge.net/squirrelmail/?rev=13885&view=rev
Author:   jangliss
Date:     2010-01-19 03:17:14 +0000 (Tue, 19 Jan 2010)

Log Message:
-----------
Fix for mailto: URLs containing a + sign.  Thanks to Michael Puls II for the patch.

Modified Paths:
--------------
    trunk/squirrelmail/doc/ChangeLog
    trunk/squirrelmail/functions/url_parser.php

Modified: trunk/squirrelmail/doc/ChangeLog
===================================================================
--- trunk/squirrelmail/doc/ChangeLog	2010-01-19 03:15:12 UTC (rev 13884)
+++ trunk/squirrelmail/doc/ChangeLog	2010-01-19 03:17:14 UTC (rev 13885)
@@ -326,6 +326,8 @@
   - Implemented security token system. (Secunia Advisory SA34627)
   - Fix issue with multi-part related messages not showing all attachments \
                (#2830140).
   - Fix for security token missing in newmail plugin (#2919418).
+  - Fix for mailto: urls containing + characters, thanks to Michael Puls II for the 
+    patch.
 
 Version 1.5.1 (branched on 2006-02-12)
 --------------------------------------

Modified: trunk/squirrelmail/functions/url_parser.php
===================================================================
--- trunk/squirrelmail/functions/url_parser.php	2010-01-19 03:15:12 UTC (rev 13884)
+++ trunk/squirrelmail/functions/url_parser.php	2010-01-19 03:17:14 UTC (rev 13885)
@@ -146,9 +146,15 @@
             if ((preg_match($MailTo_PReg_Match, $mailto, $regs)) && ($regs[0] != \
'')) {  //sm_print_r($regs);
                 $mailto_before = $target_token . $regs[0];
-                $mailto_params = $regs[10];
+                /**
+                 * '+' characters in a mailto URI don't need to be percent-encoded.
+                 * However, when mailto URI data is transported via HTTP, '+' must
+                 * be percent-encoded as %2B so that when the HTTP data is
+                 * percent-decoded, you get '+' back and not a space.
+                 */
+                $mailto_params = str_replace("+", "%2B", $regs[10]);
                 if ($regs[1]) {    //if there is an email addr before '?', we need \
                to merge it with the params
-                    $to = 'to=' . $regs[1];
+                    $to = 'to=' . str_replace("+", "%2B", $regs[1]);
                     if (strpos($mailto_params, 'to=') > -1)    //already a 'to='
                         $mailto_params = str_replace('to=', $to . '%2C%20', \
$mailto_params);  else {


This was sent by the SourceForge.net collaborative development platform, the world's \
largest Open Source development site.

------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
-----
squirrelmail-cvs mailing list
List address: squirrelmail-cvs@lists.sourceforge.net
List info (subscribe/unsubscribe/change options): \
                https://lists.sourceforge.net/lists/listinfo/squirrelmail-cvs
Repository: http://squirrelmail.org/svn


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic