Bug 60275 - When creating mailto: link, it doesnt do url encode of subject
Summary: When creating mailto: link, it doesnt do url encode of subject
Status: RESOLVED FIXED
Alias: None
Product: quanta
Classification: Miscellaneous
Component: general (show other bugs)
Version: 3.1.1
Platform: unspecified Linux
: NOR normal (vote)
Target Milestone: ---
Assignee: András Manţia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-06-23 16:51 UTC by Miroslav Maiksnar
Modified: 2003-06-24 12:45 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
ULR encoding algorithm taken from the PHP spurce code (1.44 KB, text/x-csrc)
2003-06-24 11:22 UTC, Miroslav Maiksnar
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Miroslav Maiksnar 2003-06-23 16:51:07 UTC
Version:           3.1.1 (using KDE 3.1.1)
Installed from:     (3.0)
Compiler:          gcc version 2.95.4 20011002 (Debian prerelease)
OS:          Linux (i686) release 2.4.20-custom.1.3

When inserting email link (menu tags->other->email), when I enter subject of email, It doesn't url encode text for example when I enter subject "Do you like M&M's?", resulting link is:
<a href="mailto:someone@somewhere.com?subject=Do you like M&M's?">mail</a>
Comment 1 András Manţia 2003-06-24 11:05:43 UTC
Subject: Re:  New: When creating mailto: link, it doesnt do url encode of subject

Can you give me the correct encoding, how it should look like. I'm mainly a 
C++ developer, not a HTML one. :-(

Andras


Comment 2 Miroslav Maiksnar 2003-06-24 11:22:46 UTC
Created attachment 1877 [details]
ULR encoding algorithm taken from the PHP spurce code

I hope I didn't break any license by attaching source code of this function ;o/
Comment 3 Miroslav Maiksnar 2003-06-24 11:54:32 UTC
URL encoded line should look like this: Do+you+like+M%26M%5C%27s%3F
Comment 4 András Manţia 2003-06-24 12:45:16 UTC
Subject: quanta

CVS commit by amantia: 

Encode the subject in a mailto url [#60275].

CCMAIL: 60275-done@bugs.kde.org


  M +1 -0      ChangeLog   1.181
  M +1 -1      quanta/quantaview_slots.cpp   1.96


--- quanta/quanta/quantaview_slots.cpp  #1.95:1.96
@@ -172,5 +172,5 @@ void QuantaView::slotTagMail()
       tag += QuantaCommon::attrCase(" href=")+qConfig.attrValueQuotation+"mailto:"+mailDlg->lineEmail->text();
         if ( !QString(mailDlg->lineSubject->text()).isEmpty())
-         tag += "?subject="+mailDlg->lineSubject->text();
+         tag += "?subject="+KURL::encode_string(mailDlg->lineSubject->text());
          tag += qConfig.attrValueQuotation;
     }

--- quanta/ChangeLog  #1.180:1.181
@@ -50,4 +50,5 @@
     - don't close quanta, if the user cancelled the toolbar saving [#59952]
     - warn about existing files on rename [#60187]
+    - encode the subject in a mailto url [#60275]
 
   - new features: