Page MenuHomePhabricator

Searching for <number>:<number> leads to Special:Contributions
Closed, ResolvedPublic

Description

Searching for two numbers with less than 5 digits separated by a colon (like 1234:1234) takes you to contribution list for that username (Special:Contributions/1234:1234). This occurs when using either search field and go button (but not search button), or when using links or urls like [[Special:Search/123:123]].

If one or both numbers have at least 5 digits, searching appears to work correctly.


Version: 1.16.x
Severity: normal
URL: http://sv.wikipedia.org/wiki/Special:Search/1:2

Details

Reference
bz19003

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 10:37 PM
bzimport set Reference to bz19003.
bzimport added a subscriber: Unknown Object (MLST).

herd wrote:

This is the fault of some lazy IPv6 regex. A valid IP address in Special:Search is supposed to take you to the Special:Contributions of that IP. See http://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/includes/IP.php and:

http://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/includes/SearchEngine.php

  1. Entering an IP address goes to the contributions page
		if ( ( $title->getNamespace() == NS_USER && User::isIP($title->getText() ) )
			|| User::isIP( trim( $searchterm ) ) ) {
			return SpecialPage::getTitleFor( 'Contributions', $title->getDBkey() );
		}

Ok judging by http://en.wikipedia.org/wiki/IPv6 it looks like 1234:1234 is *not* a valid IPv6 address... but 1234::1234 is. :)

I can confirm this experimentally:

$ ping6 1234:1234
ping6: nodename nor servname provided, or not known

$ ping6 1234::1234
ping6: UDP connect: No route to host

A fixup to the regex checks should be able to clear this up.