Add more protections to gnus-search query parsing

* lisp/gnus/gnus-group.el (gnus-group-make-search-group,
gnus-group-read-ephemeral-search-group): If the query is coming in via
the old 'nnir-query-spec key, we know not to parse it.
* lisp/gnus/gnus-search.el (gnus-search-make-query-string): Check if
the query was sent in as '(query "query"), and not '(query . "query).
(gnus-search-imap-search-keys): Add x-gm-raw to imap search keys.
(gnus-search-prepare-query): If we know this query should be raw,
don't even try parsing it, as it probably won't work.
This commit is contained in:
Eric Abrahamsen 2020-11-08 16:32:10 -08:00
parent 74de386a8a
commit 795b7da16b
2 changed files with 23 additions and 8 deletions

View file

@ -3201,6 +3201,10 @@ non-nil SPECS arg must be an alist with `search-query-spec' and
(cdr (assq 'search-query-spec specs))
(cdr (assq 'nnir-query-spec specs))
(gnus-search-make-spec no-parse))))
;; If our query came via an old call to nnir, we know not to
;; parse the query.
(when (assq 'nnir-query-spec specs)
(setf (alist-get 'raw query-spec) t))
(gnus-group-make-group
name
(list 'nnselect "nnselect")
@ -3245,6 +3249,10 @@ non-nil SPECS arg must be an alist with `search-query-spec' and
(or (cdr (assq 'search-query-spec specs))
(cdr (assq 'nnir-query-spec specs))
(gnus-search-make-spec no-parse))))
;; If our query came via an old call to nnir, we know not to parse
;; the query.
(when (assq 'nnir-query-spec specs)
(setf (alist-get 'raw query-spec) t))
(gnus-group-read-ephemeral-group
(concat "nnselect-" (message-unique-id))
(list 'nnselect "nnselect")