Page MenuHomePhabricator

[Task] Select site in siteselector based on pasted subdomain
Closed, ResolvedPublic

Description

Similar to T117763 there could be a super trivial guessing game going on in the siteselector (client-side JavaScript). When you paste a full URL (for example https://de.wikipedia.org/wiki/Heinrich_Kaminski) and this gets you an empty result set, a super-trivial regular expression like /\W(\w+)/ could extract the subdomain and make a second guess based on that. This regex searches for the first word that is preceded by a non-word character and would find the word "en" in (en), //en.wikipedia.org and other strings like foo en bar.

This could be a first step towards T49983: sitelinks ui: accept a link instead of a value from the dropdown box (also see the parent task T112241).

Event Timeline

Change 308546 had a related patch set uploaded (by Thiemo Mättig (WMDE)):
Extract subdomain when pasting full URL into siteselector

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

Change 310499 had a related patch set uploaded (by Thiemo Mättig (WMDE)):
Rework siteselector.tests to conform to JSCS/JSHint rules

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

Change 311324 had a related patch set uploaded (by Hoo man):
Extract subdomain when pasting full URL into siteselector

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

thiemowmde moved this task from incoming to in progress on the Wikidata board.
thiemowmde added a subscriber: hoo.

Change 311324 abandoned by Hoo man:
Extract subdomain when pasting full URL into siteselector

Reason:
Now also covered in the original (I62578bdfac821ec1030dde4bfca4fbf25c488da8), so this change is no longer needed.

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

Jonas moved this task from Review to Done on the Wikidata-Sprint-2016-09-21 board.

Change 310499 merged by jenkins-bot:
Rework siteselector.tests to conform to JSCS/JSHint rules

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

Change 308546 merged by jenkins-bot:
Extract subdomain when pasting full URL into siteselector

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