]> git.ipfire.org Git - thirdparty/public-inbox.git/commit
www: support POST /$INBOX/$MSGID/?x=m&q=
authorEric Wong <e@80x24.org>
Thu, 30 Mar 2023 11:29:51 +0000 (11:29 +0000)
committerEric Wong <e@80x24.org>
Fri, 31 Mar 2023 10:21:25 +0000 (10:21 +0000)
commit764035c83fe1aff1a0dda778a47b0c9751e74d34
tree3de4f3b0d89d472c864d27511f375fbb536f05fd
parent9d3b0372bdacd961928f3eabf21616849c188b00
www: support POST /$INBOX/$MSGID/?x=m&q=

This allows filtering the contents of any existing thread using
a search query.  It uses the existing THREADID column in Xapian
so we can internally add a Xapian OP_FILTER to the results.

This new functionality is orthogonal to the existing `t=1'
parameter which gives mairix-style thread expansion.  It doesn't
make sense to use `t=1' with this functionality, but it's not
disallowed, either.

The indentation change in Over->next_by_mid is to ensure
DBI->prepare_cached can share across both ->next_by_mid
and ->mid2tid.

I also noticed the existing regex for `POST /$INBOX/?x=m&q=' was
allowing extra characters.  With an added \z, it's now as strict
was originally intended and AFAIK nothing was generating invalid
URLs for it

Reported-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
Link: https://public-inbox.org/meta/aaniyhk7wfm4e6m5mbukcrhevzoc6ftctyrfwvmz4fkykwwtlj@mverfng6ytas/T/
lib/PublicInbox/Mbox.pm
lib/PublicInbox/Over.pm
lib/PublicInbox/Search.pm
lib/PublicInbox/WWW.pm
t/psgi_v2.t