* @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'] === '' ) {
new TitleValue( NS_CATEGORY,
'X' . str_repeat( 'x', 247 ) ) ],
[ str_repeat( 'x', 252 ), NS_MAIN, 'en',
- 'X' . str_repeat( 'x', 251 ) ]
+ 'X' . str_repeat( 'x', 251 ) ],
+ // Test decoding and normalization
+ [ '"ñ"', NS_MAIN, 'en', new TitleValue( NS_MAIN, '"ñ"' ) ],
];
}