Normalize input to TitleParser::parseTitle()
[lhc/web/wiklou.git] / includes / title / MediaWikiTitleCodec.php
index adbea89..b2c8521 100644 (file)
@@ -149,10 +149,13 @@ class MediaWikiTitleCodec implements TitleFormatter, TitleParser {
         * @return TitleValue
         */
        public function parseTitle( $text, $defaultNamespace = NS_MAIN ) {
+               // Convert things like é ā or 〗 into normalized (T16952) text
+               $filteredText = Sanitizer::decodeCharReferencesAndNormalize( $text );
+
                // NOTE: this is an ugly cludge that allows this class to share the
                // code for parsing with the old Title class. The parser code should
                // be refactored to avoid this.
-               $parts = $this->splitTitleString( $text, $defaultNamespace );
+               $parts = $this->splitTitleString( $filteredText, $defaultNamespace );
 
                // Relative fragment links are not supported by TitleValue
                if ( $parts['dbkey'] === '' ) {