Strip soft hyphens (U+00AD) from title
authorFomafix <fomafix@googlemail.com>
Sat, 25 Nov 2017 20:02:55 +0000 (21:02 +0100)
committerFomafix <fomafix@googlemail.com>
Thu, 10 May 2018 06:56:29 +0000 (08:56 +0200)
commit6b8a5a137d3f449b4056e3de82fa6747b45f1f9a
tree93ae0116d91e8691432432868bdfd28056c5f783
parent9114fbfdaea90a092c42b2530a6995a56449e69d
Strip soft hyphens (U+00AD) from title

This change strips all soft hyphens from the title. This is already
done for Unicode bidi characters (T5696).

URLs with soft hyphens (%C2%AD) get redirected (301) to the URL without
soft hyphens (T145605):
https://de.wikipedia.org/wiki/Bosnatal%C2%ADbahn get redirected to
https://de.wikipedia.org/wiki/Bosnatalbahn

Links in wikitext containing soft hyphen "[[Bosnatal<AD>bahn]]" (the
"<AD>" stands here for a soft hyphen) links "Bosnatalbahn" but displays
"Bosnatal<AD>bahn".

This change also allows to insert soft hyphens into the displaytitle
(T66528). This allows to insert soft hyphens into the first heading for
manual hyphenation of titles with very long words.

This change prevents access to any existing articles containing soft
hyphens in the title. After deploying this change a run of
maintenance/cleanupTitles.php must performed to rename existing titles
with soft hyphens. Before deploying this change existing articles and
redirects with soft hyphens in the title can already renamed or
deleted.

Bug: T121979
Bug: T66528
Change-Id: Ie13626c433cdb460dbf00b3bba28d1bb5a7b6d6a
RELEASE-NOTES-1.32
includes/title/MediaWikiTitleCodec.php
resources/src/mediawiki.Title/Title.js
tests/parser/parserTests.txt
tests/phpunit/includes/title/MediaWikiTitleCodecTest.php
tests/qunit/suites/resources/mediawiki/mediawiki.Title.test.js