[banshee] AmazonMp3.Store: Fix search query escaping
- From: Gabriel Burt <gburt src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [banshee] AmazonMp3.Store: Fix search query escaping
- Date: Tue, 15 Mar 2011 00:24:07 +0000 (UTC)
commit a10b1e693d526776177b842d4c3622ad32de60bf
Author: Gabriel Burt <gabriel burt gmail com>
Date: Mon Mar 14 19:22:08 2011 -0500
AmazonMp3.Store: Fix search query escaping
Fix the server to escape the query string as well when making its
redirect URL, so we don't need to escape it twice in the client.
.../Banshee.AmazonMp3.Store/StoreView.cs | 5 -----
.../Banshee.AmazonMp3.Store/server/redirect.c | 2 +-
2 files changed, 1 insertions(+), 6 deletions(-)
---
diff --git a/src/Extensions/Banshee.AmazonMp3.Store/Banshee.AmazonMp3.Store/StoreView.cs b/src/Extensions/Banshee.AmazonMp3.Store/Banshee.AmazonMp3.Store/StoreView.cs
index 20a5660..5044fef 100644
--- a/src/Extensions/Banshee.AmazonMp3.Store/Banshee.AmazonMp3.Store/StoreView.cs
+++ b/src/Extensions/Banshee.AmazonMp3.Store/Banshee.AmazonMp3.Store/StoreView.cs
@@ -147,11 +147,6 @@ namespace Banshee.AmazonMp3.Store
public override void GoSearch (string query)
{
- // Two escapes needed because on the redirect.c server it is put into
- // a URI, which is escaped and passed as an argument to Amazon's own
- // redirect server (so we can inject the affiliate code).
- // Test search: tilly & the wall
- query = System.Uri.EscapeDataString (query);
query = System.Uri.EscapeDataString (query);
LoadUri (new Uri (GetActionUrl ("search/" + query)).AbsoluteUri);
}
diff --git a/src/Extensions/Banshee.AmazonMp3.Store/server/redirect.c b/src/Extensions/Banshee.AmazonMp3.Store/server/redirect.c
index d81a95c..0eeedbd 100644
--- a/src/Extensions/Banshee.AmazonMp3.Store/server/redirect.c
+++ b/src/Extensions/Banshee.AmazonMp3.Store/server/redirect.c
@@ -112,7 +112,7 @@ main (gint argc, gchar **argv)
if (strcmp (action, "search") == 0) {
dest_url = g_strdup_printf (
"http://www.amazon.%s/s/ref=nb_sb_noss?url=search-alias%%3D%s&field-keywords=%s",
- domain, search_category, input
+ domain, search_category, g_uri_escape_string (input, NULL, TRUE)
);
} else if (strcmp (action, "sign_out") == 0) {
dest_url = g_strdup_printf (
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]