Page MenuHomePhabricator

Use history.replaceState to reconcile URLs with #DISPLAYTITLE
Open, LowestPublic

Description

T37045 added some magic to MediaWiki so article names matched the URL after a redirect.
It would be nice if similar magic also updated the URL based on the display title of the article.

For example, https://en.wikipedia.org/wiki/iPhone rewrites to https://en.wikipedia.org/wiki/IPhone, even though the article is displayed as "iPhone".

Event Timeline

MC8 created this task.Jan 16 2015, 11:22 AM
MC8 raised the priority of this task from to Needs Triage.
MC8 updated the task description. (Show Details)
MC8 added a project: MediaWiki-General.
MC8 added a subscriber: MC8.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJan 16 2015, 11:22 AM
Aklapper triaged this task as Lowest priority.Jan 16 2015, 1:54 PM
MZMcBride added a subscriber: MZMcBride.

@matmarex: Thoughts on this task? "IPhone" in the URL has only bothered me for about forever. :-)

"IPhone" in the URL has only bothered me for about forever. :-)

I meant "IPod" here. "IPhone" has only been bothering me since 2007.

This actually looks kind of hairy. Doing the same things as in T37045 would require jumping through only a few hoops (to generate the URL we want from the HTML displaytitle we have, and make it available to JS), but what about canonical URLs? What about the HTTP redirects from non-canonical forms? (https://en.wikipedia.org/wiki/dog redirects to https://en.wikipedia.org/wiki/Dog right now.) Are there any other situations this affects other than the lowercase first letter, and could they cause problems when done in the URL?

MariaDB [enwiki_p]> select page_id, page_namespace, page_title, pp_propname, pp_value
                    from page join page_props on page_id = pp_page
                    where page_title = 'Roe_v._Wade' and page_namespace = 0 and pp_propname = 'displaytitle';
+---------+----------------+-------------+--------------+--------------------+
| page_id | page_namespace | page_title  | pp_propname  | pp_value           |
+---------+----------------+-------------+--------------+--------------------+
|   68493 |              0 | Roe_v._Wade | displaytitle | <i>Roe v. Wade</i> |
+---------+----------------+-------------+--------------+--------------------+
1 row in set (0.01 sec)

Hrm.