[epiphany/gnome-2-28] ephy-web-view: url-decode javascript URIs before executing them



commit 54227d31e7c92e1cd3099356b84aca03517ef135
Author: Xan Lopez <xan gnome org>
Date:   Sun Dec 13 23:57:30 2009 +0100

    ephy-web-view: url-decode javascript URIs before executing them
    
    Fixes Amazon Add to Wishlist bookmark.
    
    Bug #604489

 embed/ephy-web-view.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/embed/ephy-web-view.c b/embed/ephy-web-view.c
index 11ac048..1918c7d 100644
--- a/embed/ephy-web-view.c
+++ b/embed/ephy-web-view.c
@@ -1143,9 +1143,13 @@ ephy_web_view_load_url (EphyWebView *view,
 
   effective_url = normalize_or_autosearch_url (view, url);
 
-  if (g_str_has_prefix (effective_url, "javascript:"))
-    webkit_web_view_execute_script (WEBKIT_WEB_VIEW (view), effective_url);
-  else
+  if (g_str_has_prefix (effective_url, "javascript:")) {
+    char *decoded_url;
+    
+    decoded_url = soup_uri_decode (effective_url);
+    webkit_web_view_execute_script (WEBKIT_WEB_VIEW (view), decoded_url);
+    g_free (decoded_url);
+  } else
     webkit_web_view_open (WEBKIT_WEB_VIEW (view), effective_url);
 
   g_free (effective_url);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]