Page MenuHomePhabricator

Implement MalformedTextException in JS and throw from mw.Title construtor
Closed, DeclinedPublic

Description

In T87314#992696, @Tgr wrote:

UW checks whether mw.Title.newFromText() is successful, and that function just returns false whether the title is too long or has invalid characters or whatever else, so I would say this has to be solved in core. (Not sure how though - maybe by mw.Title providing a validator that uses the same logic but returns error codes?)

Port MalformedTitleException to JS and throw from constructor for mw.Title so we know why a Title is unparseable.

Related Objects

View Standalone Graph
This task is connected to more than 200 other tasks. Only direct parents and subtasks are shown here. Use View Standalone Graph to show more of the graph.

Event Timeline

Sn1per claimed this task.
Sn1per raised the priority of this task from to Low.
Sn1per updated the task description. (Show Details)
Sn1per added projects: Multimedia, UploadWizard.
Sn1per edited projects, added MediaWiki-General; removed UploadWizard.
Sn1per set Security to None.
Sn1per added subscribers: Tgr, Sn1per, Lokal_Profil, Aklapper.
Aklapper lowered the priority of this task from Low to Lowest.Feb 16 2015, 5:42 PM
Aklapper edited projects, added MediaWiki-Parser; removed MediaWiki-General, Multimedia.
Aklapper removed a subscriber: Tgr.

IMO the proper fix is to not be trying to squeeze a user-submitted text description into the filename in the first place... filenames are hard to change and impossible to localize, so using 'human-readable descriptions' as filenames turned out to be a bad idea in practice.

Sn1per added subscribers: Mattflaschen-WMF, Tgr.
Sn1per removed a subscriber: Tgr.
Sn1per renamed this task from Implement Title validator that returns error codes to Implement newFromTextThrow and MalformedTextException in JS.May 15 2015, 12:28 AM
Sn1per updated the task description. (Show Details)
Sn1per added a subscriber: Tgr.
Sn1per removed a subscriber: Tgr.

Change 211077 had a related patch set uploaded (by Sn1per):
[WIP] Implement Title.newFromTextThrow and MalformedTitleException for JS

https://gerrit.wikimedia.org/r/211077

IMO the proper fix is to not be trying to squeeze a user-submitted text description into the filename in the first place... filenames are hard to change and impossible to localize, so using 'human-readable descriptions' as filenames turned out to be a bad idea in practice.

I agree.

Sn1per renamed this task from Implement newFromTextThrow and MalformedTextException in JS to Implement MalformedTextException in JS and throw from mw.Title construtor.May 22 2015, 2:51 AM
Sn1per updated the task description. (Show Details)
Sn1per added a subscriber: Tgr.

Change 211077 merged by jenkins-bot:
Implement MalformedTitleException for JS and use in constructor

https://gerrit.wikimedia.org/r/211077

Change 215345 had a related patch set uploaded (by Sn1per):
Load messages in mw.Title for specific MalformedTitleExceptions

https://gerrit.wikimedia.org/r/215345

Change 215345 abandoned by Sn1per:
mediawiki.Title: Load messages for specific MalformedTitleExceptions

Reason:
Not necessary

https://gerrit.wikimedia.org/r/215345