Explorar o código

Fixed failed search when blank surround the query string.

This time, without fucking up everything.
grunfink hai 7 meses
pai
achega
be4dd4ea7f
Modificáronse 1 ficheiros con 7 adicións e 1 borrados
  1. 7 1
      html.c

+ 7 - 1
html.c

@@ -4343,9 +4343,15 @@ int html_get_handler(const xs_dict *req, const char *q_path,
             status = HTTP_STATUS_UNAUTHORIZED;
         }
         else {
-            const char *q = xs_dict_get(q_vars, "q");
+            const char *q = NULL;
+            xs *cq = xs_dup(xs_dict_get(q_vars, "q"));
             xs *url_acct = NULL;
 
+            if (xs_is_string(cq)) {
+                cq = xs_strip_i(cq);
+                q = cq;
+            }
+
             /* searching for an URL? */
             if (q && xs_match(q, "https://*|http://*")) {
                 /* may by an actor; try a webfinger */