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 Fix failing tests relying on private Hooks.php properties 2020-04-13 22:58:26 +00:00
SearchEngineTest.php search: Fix PrefixSearch totally ignoring input like "[[Foo]]" 2020-08-20 10:50:52 +02:00
SearchNearMatcherTest.php Fix visibility of setUp/tearDown 2020-06-16 21:02:05 +02:00
SearchNearMatchResultSetTest.php build: Bump mediawiki-codesniffer to 31.0.0 2020-05-30 14:56:28 +00:00
SearchResultSetTest.php MediaWikiTestCase to MediaWikiIntegrationTestCase 2020-06-30 17:02:22 +01:00
SearchResultTraitTest.php MediaWikiTestCase to MediaWikiIntegrationTestCase 2020-06-30 17:02:22 +01:00