Last modified: 2013-12-01 20:41:38 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T42588, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 40588 - Special:LinkSearch cannot search with a port in the url
Special:LinkSearch cannot search with a port in the url
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Special pages (Other open bugs)
1.20.x
All All
: Normal normal (vote)
: 1.23.0 release
Assigned To: MrBlueSky
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-09-28 07:48 UTC by Umherirrender
Modified: 2013-12-01 20:41 UTC (History)
5 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Umherirrender 2012-09-28 07:48:08 UTC
Giving a url with a port to search form of Special:LinkSearch, will not find the url.

A user on de.wp was searching for:

http://www.gencat.net:8000/osial/owa/p01.dad_ens?via=0&cod=0800180001

This results in a query (on my localhost, git master):
SELECT page_namespace AS namespace, page_title AS title, el_index AS value, el_to AS url
FROM `page` , `externallinks` 
FORCE INDEX ( el_index ) 
WHERE (
page_id = el_from
)
AND (
el_index LIKE 'http://net:8000.gencat.www./osial/owa/p01.dad\_ens?via=0&cod=0800180001%'

But el_index in the database is:
http://net.gencat.www.:8000/osial/owa/p01.dad_ens?via=0&cod=0800180001

which cannot match, because the database has the port after domain and the special page put the port after the tld, which looks strange.
Comment 1 MrBlueSky 2012-10-18 20:46:49 UTC
There are a few problems with the linksearch:
* When no protocol is specified it defaults to http://, except when you specify a port: this makes the search not use a protocol at all (finding nothing).
* When both a protocol and a port are specified the LIKE clause created is wrong, because it treats the port as part of the domain and it gets moved to the front. 
* It doesnt handle urls with names and passwords correctly.
* The standard text on the page says you should not include the protocol in the search. But this not correct: to find links for any protocol other than http://, the protocol should be specified.
Comment 2 MrBlueSky 2012-10-24 13:41:10 UTC
Gerrit change #28908
Comment 3 MrBlueSky 2012-12-21 22:10:01 UTC
I have to put this cookie back. Fixing this is not as easy as it looks. I keep bumping into special cases needing extra checks and workarounds. Maybe the linksearch functionality should be rewritten from scratch, including support for ipv4 addresses (currently done ad hoc by LinkSearchPage::mungeQuery()) and more general wildcard support (like "ftp://*" to get all ftp links, etc).
Comment 4 Jesús Martínez Novo (Ciencia Al Poder) 2013-01-27 10:48:12 UTC
(In reply to comment #3)
> I have to put this cookie back. Fixing this is not as easy as it looks. I
> keep
> bumping into special cases needing extra checks and workarounds. Maybe the
> linksearch functionality should be rewritten from scratch, including support
> for ipv4 addresses (currently done ad hoc by LinkSearchPage::mungeQuery())
> and
> more general wildcard support (like "ftp://*" to get all ftp links, etc).

The current changeset solves this problem and the general wildcard support, so I think this one is perfectly eligible for 1.21 release.

Of course, you can improve ipv4 support but that's not related to this bug ;)
Comment 5 Andre Klapper 2013-03-21 14:58:52 UTC
Reminder: As this has the 1.21.0 target milestone set, this patch needs to get more reviews and merged in the next weeks to include it in 1.21.0.
Comment 6 Gerrit Notification Bot 2013-12-01 18:49:35 UTC
Change 28908 merged by Brian Wolff:
(bug 40588) LinkSearch cannot search with a port in the url

https://gerrit.wikimedia.org/r/28908

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links