Page MenuHomePhabricator

Incorrect link to Yahoo Search
Closed, ResolvedPublic

Description

Author: jtatsu

Description:
Hello,

My name is Junichi Tatsu and I work in the technical support team of Yahoo! Search.
It has come to our attention that if you click on the "Yahoo" button in the following page:
http://sv.wikipedia.org/w/index.php?ns0=1&search=silo+breaker&title=Special%3AS%C3%B6k&fulltext=Advanced+search&fulltext=Avancerad+s%C3%B6kning

it will redirect to the following URL:
http://sv.search.yahoo.com/search?p=silo+breaker&ns0=1&title=Special%3AS%C3%B6k&fulltext=Search&fulltext=S%C3%B6k&searchengineselect=yahoo&vs=http%3A%2F%2Fsv.wikipedia.org

which is not a valid hostname and will result in a http 404.

We have made a temporary fix but would appreciate it if you could have it fixed to:
http://se.search.yahoo.com/search?p=silo+breaker&ns0=1&title=Special%3AS%F6k&fulltext=Search&fulltext=S%F6k&searchengineselect=yahoo&vs=http%3A%2F%2Fsv.wikipedia.org

(note the se.search... Instead of sv.search...)

Would this be something you could fix?

Best regards,
Junichi Tatsu
Yahoo! Search


Version: unspecified
Severity: enhancement
URL: http://sv.wikipedia.org/w/index.php?ns0=1&search=silo+breaker&title=Special%3AS%C3%B6k&fulltext=Advanced+search&fulltext=Avancerad+s%C3%B6kning

Details

Reference
bz18848

Event Timeline

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

Here's the offending code on the site:

http://sv.wikipedia.org/wiki/MediaWiki:Common.js

// Sökfunktion med flera sökmotorer
/ Change Special:Search to use a radio menu *************

  • Description: Change Special:Search to use a radio menu, with the default being
  • the internal MediaWiki engine
  • Created and maintained by: [[:fr:User:Pmartin]] */

if ((wgNamespaceNumber == -1) && (wgCanonicalSpecialPageName == "Search")) {
var searchEngines = {

	  mediawiki: {
	    ShortName: "Wikipedia-sök",
	    Template: "/w/index.php?search={searchTerms}"
	  },
	  yahoo: {
	    ShortName: "Yahoo!",
	    Template: "http://" + wgUserLanguage + ".search.yahoo.com/search?p={searchTerms}&vs=" + wgServer
	  },

[snip]

wgUserLanguage will be 'sv', 'en', 'fr', etc... whereas the hostnames vary, but seem to be using country codes:

  • se.search.yahoo.com
  • fr.search.yahoo.com
  • de.search.yahoo.com
  • jp.search.yahoo.com -> search.yahoo.jp
  • us.search.yahoo.com

Language codes just don't work except in a few countries/language that happen to match up like fr and de. If the language code can't be appended, it should just head straight to the Swedish server.

Bad code was introduced April 6 2009:
http://sv.wikipedia.org/w/index.php?title=MediaWiki:Common.js&diff=8931878&oldid=8672428

I've fixed it there and dropped a note on-wiki to [[fr:User:Pmartin]] about the issue; the fix may need to be replicated on other sites. (Pascal wouldn't have noticed the bug if his UI language was set to French.)

Note that aggressive caching of site JavaScript means that not all end-users will see the fix immediately; it may take up to 30 days to ensure that all visitors are updated.