[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Search]

Patch:: Tiny Bug in emacspeak-bookshare



Hi,
There's a problem when searching on Bookshare. When doing, for example, a full text search with `s' in the Bookshare buffer, if you enter a search string with space in it, like "learn emacs" you will get an error saying that this does not seem like a Bookshare response.
This is because the URL, when constructed, is not url-encoded. Here is a tiny patch to fix that:
1 file changed, 9 insertions(+), 8 deletions(-)
lisp/emacspeak-bookshare.el | 17 +++++++++--------

modified   lisp/emacspeak-bookshare.el
@@ -192,14 +192,15 @@ with X-password HTTP header for use with Curl."
   "Return  URL  end point for specified operation.
 Optional argument `noauth' says no user auth needed."
   (cl-assert emacspeak-bookshare-api-key nil "API key not set.")
-  (format "%s/%s/%s/%s?api_key=%s"
-          emacspeak-bookshare-api-base
-          operation
-          operand
-          (if noauth
-              ""
-            (format "for/%s" emacspeak-bookshare-user-id))
-          emacspeak-bookshare-api-key))
+  (url-encode-url
+   (format "%s/%s/%s/%s?api_key=%s"
+           emacspeak-bookshare-api-base
+           operation
+           operand
+           (if noauth
+               ""
+             (format "for/%s" emacspeak-bookshare-user-id))
+           emacspeak-bookshare-api-key)))
 
 (defun emacspeak-bookshare-page-rest-endpoint ()
   "Generate REST endpoint for the next page of results."



|May 1995 - Last Year |Current Year


If you have questions about this archive or had problems using it, please contact us.

Contact Info Page