New $filters encoding which avoids collisions
commit83b8c343367922dc5bb8cc6d54edf20fe898d775
authorOlly Betts <olly@survex.com>
Fri, 23 Oct 2015 02:34:51 +0000 (23 15:34 +1300)
committerOlly Betts <olly@survex.com>
Fri, 23 Oct 2015 02:34:51 +0000 (23 15:34 +1300)
treec0d41bdb1f43a7b5ed81a7269da03a9f99076bb4
parentc841dfebc996896e9c97d31c6eacba6f523ecbe4
New $filters encoding which avoids collisions

Use '~' as the filter separator, as it shouldn't get URL encoded, and is
less likely to appear in a filter than '-' (which we were using).

If '~' does appear in a filter, double it.  And make sure that the first
item after the filters can't be empty and can't start with '~' or an
alpha-numeric, so that the encoding is unambiguous (we only accept
filter terms that start with an alpha-numeric).

We internally build the old value that $filters would have returned, and
also check CGI parameter xFILTERS against that, so that on upgrades old
format serialised filters are handled correctly.
xapian-applications/omega/omega.cc
xapian-applications/omega/omega.h
xapian-applications/omega/query.cc