Go search to consider fragment only title invalid
authorErik Bernhardson <ebernhardson@wikimedia.org>
Mon, 10 Sep 2018 20:29:08 +0000 (13:29 -0700)
committerErik Bernhardson <ebernhardson@wikimedia.org>
Tue, 11 Sep 2018 20:03:53 +0000 (13:03 -0700)
commitb3574162737da627c76fcb9ddfb43918452b5519
treee218b0bb24ae4150af037dd9dd112a28973ba4c9
parent35bb2344520de9c250841d92e39ac71f25011d65
Go search to consider fragment only title invalid

When submiting using the 'go' feature of Special:Search (standard
usecase for autocomplete) a nearby title can be selected.
Unfortunately a fragment only title is considered valid, which
sends the user to Main_Page#searchterm.

Instead don't allow a search starting with # to trigger the go
feature.

Bug: T182452
Change-Id: I8ce3ce8633e23db41ae6eafb9996ca7294f8445a
includes/search/SearchNearMatcher.php
tests/phpunit/includes/search/SearchNearMatcherTest.php [new file with mode: 0644]