wiki.techinc.nl/tests/phpunit/includes/search
Thiemo Kreuz 5f9a85f36d search: Fix PrefixSearch totally ignoring input like "[[Foo]]"
I found this while working on T249167. Searching for something like
"[" or copy-pasting something like "[[Foo]]" simply returns
*all* pages, in alphabetical order. This is unexpected.

A worst-case example is
api.php?action=opensearch&search=Test
vs.
api.php?action=opensearch&search=Test]
While the first example behaves as expected (it will either find
pages with this prefix, or nothing if there is none), the second
will return the entire database.

Expected: It should either find nothing, or pages that start with
"Test".

Note this patch intentionally does not fix one edge-case: Input
like "[" will still return all pages. I left this untouched for
now because it might be used as a feature somewhere.

Note you can not test this on Wikimedia wikis because they don't
use this search backend. Which is just another reason to fix this.
On Wikipedia, searching for "[[Test]]" works just fine.

Change-Id: I877297f69ca560460766e1035e02b009919054e1
2020-08-20 10:50:52 +02:00
..
ParserOutputSearchDataExtractorTest.php
SearchEnginePrefixTest.php
SearchEngineTest.php search: Fix PrefixSearch totally ignoring input like "[[Foo]]" 2020-08-20 10:50:52 +02:00
SearchNearMatcherTest.php
SearchNearMatchResultSetTest.php
SearchResultSetTest.php
SearchResultTraitTest.php