diff options
| author | 2025-12-26 21:24:08 +0100 | |
|---|---|---|
| committer | 2025-12-26 21:24:08 +0100 | |
| commit | be4dd4ea7f58a31546ad873d5b464fdb8b289ec8 (patch) | |
| tree | 90f86d08111fcbf0704d183808b617d4baa119f8 | |
| parent | Revert "Fixed failed search when blank surround the query string." (diff) | |
| download | snac2-be4dd4ea7f58a31546ad873d5b464fdb8b289ec8.tar.gz snac2-be4dd4ea7f58a31546ad873d5b464fdb8b289ec8.tar.xz snac2-be4dd4ea7f58a31546ad873d5b464fdb8b289ec8.zip | |
Fixed failed search when blank surround the query string.
This time, without fucking up everything.
| -rw-r--r-- | html.c | 8 |
1 files changed, 7 insertions, 1 deletions
| @@ -4343,9 +4343,15 @@ int html_get_handler(const xs_dict *req, const char *q_path, | |||
| 4343 | status = HTTP_STATUS_UNAUTHORIZED; | 4343 | status = HTTP_STATUS_UNAUTHORIZED; |
| 4344 | } | 4344 | } |
| 4345 | else { | 4345 | else { |
| 4346 | const char *q = xs_dict_get(q_vars, "q"); | 4346 | const char *q = NULL; |
| 4347 | xs *cq = xs_dup(xs_dict_get(q_vars, "q")); | ||
| 4347 | xs *url_acct = NULL; | 4348 | xs *url_acct = NULL; |
| 4348 | 4349 | ||
| 4350 | if (xs_is_string(cq)) { | ||
| 4351 | cq = xs_strip_i(cq); | ||
| 4352 | q = cq; | ||
| 4353 | } | ||
| 4354 | |||
| 4349 | /* searching for an URL? */ | 4355 | /* searching for an URL? */ |
| 4350 | if (q && xs_match(q, "https://*|http://*")) { | 4356 | if (q && xs_match(q, "https://*|http://*")) { |
| 4351 | /* may by an actor; try a webfinger */ | 4357 | /* may by an actor; try a webfinger */ |