]> spindle.queued.net Git - midori/commitdiff
Correctly rewrite user style URI
authorChristian Dywan <christian@twotoasts.de>
Fri, 28 Oct 2011 22:57:44 +0000 (00:57 +0200)
committerChristian Dywan <christian@twotoasts.de>
Fri, 28 Oct 2011 22:57:44 +0000 (00:57 +0200)
extensions/addons.c

index 0347e158d782d893e7ab51acad4c090a8e3dd90c..07e997e3141960b0aab71adda5887916b4ec86a2 100644 (file)
@@ -129,6 +129,7 @@ addons_install_response (GtkWidget*  infobar,
                     const gchar* js_script;
                     WebKitWebView* web_view;
                     WebKitWebFrame* web_frame;
+                    gchar** script_id;
 
                     js_script = "document.getElementById('heading').childNodes[3].childNodes[1].textContent";
                     web_view = WEBKIT_WEB_VIEW (midori_view_get_web_view (view));
@@ -144,8 +145,10 @@ addons_install_response (GtkWidget*  infobar,
                     }
 
                     /* rewrite uri to get source js */
+                    script_id = g_strsplit (subpage + 1, "/", 2);
                     temp_uri = g_strdup_printf ("http://%s/scripts/source/%s.user.js",
-                                                hostname, subpage + 1);
+                                                hostname, script_id[0]);
+                    g_strfreev (script_id);
                     uri = temp_uri;
                     folder = "scripts";
                 }