From: Fabian Keil <fk@fabiankeil.de>
Date: Sun, 6 Sep 2009 15:07:55 +0000 (+0000)
Subject: Use encodeURIComponent() instead of escape() which doesn't encode all characters... 
X-Git-Tag: v_3_0_15~78
X-Git-Url: http://www.privoxy.org/gitweb/@default-cgi@/faq/%22https:/user-manual/diff?a=commitdiff_plain;h=6576d21c2f38f5e1501d243e3b123d51a06b8388;p=privoxy.git

Use encodeURIComponent() instead of escape() which doesn't encode all characters we care about.

Anonymously reported in #2832722.
---

diff --git a/templates/edit-actions-list b/templates/edit-actions-list
index 3ed4df5c..b32cbb62 100644
--- a/templates/edit-actions-list
+++ b/templates/edit-actions-list
@@ -5,7 +5,7 @@
 # Purpose     :  Template used to edit the actions file.
 # 
 #
-# Copyright   :  Written by and Copyright (C) 2001-2007 the SourceForge
+# Copyright   :  Written by and Copyright (C) 2001-2009 the
 #                Privoxy team. http://www.privoxy.org/
 #
 #                Original Author: Copyright (C) 2001 Jonathan Foster
@@ -136,7 +136,7 @@ function e_p(link,pattern,curtext)
    if ((newtext=window.prompt("Edit the pattern to your needs:", unescape(curtext))) != null)
    {
       if (newtext != "")
-      { link.href="edit-actions-url?f=@f@&v=@v@&p="+pattern+"&u="+escape(newtext); }
+      { link.href="edit-actions-url?f=@f@&v=@v@&p="+pattern+"&u="+encodeURIComponent(newtext); }
       else
       { link.href="edit-actions-remove-url?f=@f@&v=@v@&p="+pattern; }
       return true;
@@ -148,7 +148,7 @@ function a_p(link,section)
 {
    if (((newtext=window.prompt("Enter the new pattern:", "")) != null ) && (newtext != ""))
    {
-      link.href="edit-actions-add-url?f=@f@&v=@v@&s="+section+"&u="+escape(newtext);
+      link.href="edit-actions-add-url?f=@f@&v=@v@&s="+section+"&u="+encodeURIComponent(newtext);
       return true;
    }
    return false;