(bug 40588) LinkSearch cannot search with a port in the url
authormrbluesky <mrbluesky@wikipedia.be>
Sun, 21 Oct 2012 13:01:56 +0000 (15:01 +0200)
committerBrian Wolff <bawolff+wn@gmail.com>
Sun, 1 Dec 2013 19:10:14 +0000 (15:10 -0400)
commitd4d6819a75f45de4c0234bf84563e5f98ca13700
tree1d6696beac19ab179fb5eb6e8835495509067995
parent154751a8f4efa5c725dfe105c611bea515b54969
(bug 40588) LinkSearch cannot search with a port in the url

Special:LinkSearch doesn't handle urls with a port correctly.

The detection of the protocol to search for (in LinkSearchPage::execute()) cant handle
the extra colon a port introduces in the url. Fixed by making LinkSearchPage::execute
use wfParseUrl() to detect the protocol.

LinkFilter::makeLikeArray didn't handle the port correctly too, putting it in the
domain part of the url. Fixed by rewriting makeLikeArray to make use of wfParseUrl().
This also fixes the problem of makeLikeArray not removing username and pass from
the search pattern.

Allow queries like 'ftp://*' or 'mailto:*' to find all links with specific protocols

Bug: 40588
Change-Id: Id3dd31993456bf6cbba4cf17962cf0083b612bed
includes/LinkFilter.php
includes/specials/SpecialLinkSearch.php
tests/phpunit/includes/LinkFilterTest.php [new file with mode: 0644]