Page MenuHomePhabricator

legaltitlechars in mw.config and from API don't match (\xFF is not the same as \uFFFF)
Open, LowPublic

Description

The value mw.config.get('wgLegalTitleChars') in the JS interface and the legaltitlechars value from ApiQuerySiteInfo are not same or equivalent.

Running the following in the javascript console:

new mw.Api().get( {
	"meta": "siteinfo",
	"siprop": "general"
} ).then( function( data ) {
	console.log( data.query.general.legaltitlechars + '\t\tAPI version' );
	console.log( mw.config.get('wgLegalTitleChars') + '\tmw.config version' );
} );

gives:

%!"$&'()*,\-.\/0-9:;=?@A-Z\\^_`a-z~\x80-\xFF+		API version
%!"$&'()*,\-./0-9:;=?@A-Z\\\^_`a-z~+\u0080-\uFFFF	mw.config version

\xFF isn't the same as \uFFFF, apart from the apparent differences in the number of \ characters used for escaping.

Shouldn't these be the equivalent?

The mw.config version seems to be the correct one. There are some titles such as File:Michał Cieślak Sejm 2016.JPG containing \u0142 and \u015b, which shouldn't be allowed according to the API version.

Event Timeline

SD0001 created this task.Thu, May 21, 2:18 PM
Restricted Application added a project: Core Platform Team. · View Herald TranscriptThu, May 21, 2:18 PM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
SD0001 updated the task description. (Show Details)Thu, May 21, 2:21 PM
Aklapper renamed this task from legaltitlechars in mw.config and from API don't match to legaltitlechars in mw.config and from API don't match (\xFF is not the same as \uFFFF).Fri, May 22, 9:25 AM
SD0001 updated the task description. (Show Details)Mon, May 25, 1:24 PM
eprodromou triaged this task as Low priority.Tue, May 26, 8:24 PM
eprodromou added a subscriber: eprodromou.

OK, we'll take a look.