mw.Title: Correct handling of Unicode whitespace and bidi control characters
authorBartosz Dziewoński <matma.rex@gmail.com>
Wed, 24 Aug 2016 19:33:45 +0000 (21:33 +0200)
committerKrinkle <krinklemail@gmail.com>
Wed, 31 Aug 2016 00:04:29 +0000 (00:04 +0000)
commit71ec883cb379c0cda193715b7eccddca6f31a1d8
treeb72e5cda0d3d740cca9588131a62155b7b45b64a
parentb54961e7bc79e2e2c658bf9ae7aa47a5e36f8653
mw.Title: Correct handling of Unicode whitespace and bidi control characters

MediaWiki titles may not contain Unicode bidi control characters, e.g.
U+200E LEFT-TO-RIGHT MARK. They are silently stripped and such a
title is considered valid.

MediaWiki titles may not contain any whitespace other than a regular
space. Most of them are silently replaced with a regular space and
such a title is considered valid, but there are some (e.g. the tab
character) which make the title invalid. I'm not sure if this is an
intentional behavior, but I added a test case to verify it.

Bug: T143759
Change-Id: If8fad1f896027c5d93a62b0785923a39136c6a36
resources/src/mediawiki/mediawiki.Title.js
tests/phpunit/includes/TitleTest.php
tests/qunit/suites/resources/mediawiki/mediawiki.Title.test.js