Re: Patch for mailto: link urlencoding

"Michael A. Puls II" <[email protected]>
Newsgroups gmane.mail.squirrelmail.devel
Message-ID <op.u6g8gjpy1ejg13@sandra-svwliu01>
On Wed, 13 Jan 2010 09:36:02 -0500, Michael A. Puls II  
<[email protected]> wrote:

> On Wed, 13 Jan 2010 08:26:32 -0500, Michael A. Puls II  
> <[email protected]> wrote:
>
>> On Wed, 13 Jan 2010 08:00:18 -0500, Michael A. Puls II  
>> <[email protected]> wrote:
>>
>>> On Wed, 13 Jan 2010 07:48:13 -0500, Michael A. Puls II  
>>> <[email protected]> wrote:
>>>
>>>> On Tue, 12 Jan 2010 13:58:59 -0500, Jon Nathan  
>>>> <[email protected]> wrote:
>>>>
>>>>> Thanks for your feedback.  What do you think the appropriate way
>>>>> to adress this is?  I'd hate to only urlencode specific characters.
>>>>
>>>> I think the relevant code is actually in parseUrl() in  
>>>> functions/url_parser.php.
>>>>
>>> In url_parser.php, in parseUrl, after:
>>> $mailto = substr($body, $target_pos, $end-$target_pos);
>>> add this line:
>>> $mailto = preg_replace("/\\+/", "%2B", $mailto);
>>> for example.
>>>
>>> That will fix things.
>>
>> That does fix things, but it breaks some other things. The replacement  
>> of the '+' characters causes the length to be longer, which messes up  
>> other calculations down the code a bit. Will investigate.
>
> O.K. disregard the previous fix and try this:
> Change the following line:
> $mailto_params = $regs[10];
> to:
> $mailto_params = preg_replace("/\\+/", "%2B", $regs[10]);
>
> and see if that works.

That does work, but it doesn't do the replacement before '?'.

So, *also* change:
$to = 'to=' .$regs[1];
to:
$to = 'to=' . preg_replace("/\\+/", "%2B", $regs[1]);

-- 
Michael

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
-----
squirrelmail-devel mailing list
Posting guidelines: http://squirrelmail.org/postingguidelines
List address: [email protected]
List archives: http://news.gmane.org/gmane.mail.squirrelmail.devel
List info (subscribe/unsubscribe/change options): https://lists.sourceforge.net/lists/listinfo/squirrelmail-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.