fix freesound URL parameter escape
authorRobin Gareus <robin@gareus.org>
Fri, 21 Dec 2012 13:44:53 +0000 (13:44 +0000)
committerRobin Gareus <robin@gareus.org>
Fri, 21 Dec 2012 13:44:53 +0000 (13:44 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@13698 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/sfdb_freesound_mootcher.cc

index a1cb4a969e222bc67f079892264227c3cb41b19e..ed4fd617a9ae0863cadc526b8826bb34742e1d5b 100644 (file)
@@ -211,11 +211,16 @@ std::string Mootcher::searchText(std::string query, int page, std::string filter
                snprintf(buf, 23, "p=%d&", page);\r
                params += buf;\r
        }\r
-       \r
-       params += "q=" + query; \r
 \r
-       if (filter != "")\r
-               params += "&f=" + filter;\r
+       char *eq = curl_easy_escape(curl, query.c_str(), query.length());\r
+       params += "q=" + std::string(eq);\r
+       free(eq);\r
+\r
+       if (filter != "") {\r
+               char *ef = curl_easy_escape(curl, filter.c_str(), filter.length());\r
+               params += "&f=" + std::string(ef);\r
+               free(ef);\r
+       }\r
        \r
        if (sort)\r
                params += "&s=" + sortMethodString(sort);\r