Re: Patch for mailto: link urlencoding

"Michael A. Puls II" <[email protected]>
Newsgroups gmane.mail.squirrelmail.devel
Message-ID <op.u6fvwkik1ejg13@sandra-svwliu01>
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 haven't really messed with the code (not familiar with it at all), but  
the conversion of mailto links to SquirrelMail compose links seems to be  
in functions/mime.php. Look for:

if ($take_mailto_links) {

That's where I would check to see what the code is doing with '+'  
characters. If it's just leaving them alone, you could do a quick fix and  
replace all '+' with '%2B'. Then, the http link the code produces should  
work fine.

As for being more robust and handling complicated mailto URIs, it doesn't  
look like the code does this as it's just using regex to doctor up the  
mailto URI into a query string. But, I could be wrong as I don't know the  
code. But, if you look at <http://shadow2531.com/sm/html5_mailto.php.zip>,  
you can see how you can take a mailto URI (once you got it) and parse it  
into the individual to, cc, bcc, subject and body parts you need while  
normalizing everything etc. From those raw values, you can easily produce  
a good compose.php? query string (once you rawurlencode them).

Just remember when percent-decoding mailto data, you use  
<http://php.net/manual/en/function.rawurldecode.php> and when  
percent-encoding mailto data, you use  
<http://www.php.net/manual/en/function.rawurlencode.php>.

I'll try messing with the code soon to familiarize myself with it. Then  
maybe I can help more.

-- 
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.