Page MenuHomePhabricator

Invalid titles cause an TypeError: "mwTitle is null" when looking for a signature in a comment
Closed, ResolvedPublic

Description

Steps to reproduce:

  1. Add a comment with an external link to a wikipage with an illegal character (here it is |): [https://fr.wikipedia.org/wiki/MediaWiki| Test].
  2. Save the comment.
  3. Refresh the page.
  4. Yay the TypeError!

In this case, title = getPageTitleFromUri( "https://fr.wikipedia.org/wiki/MediaWiki|" ) returns MediaWiki| and mwTitle = mw.Title.newFromText( title ) returns null.

The very first check on the title causes the TypeError.

Here an example. Can be reproduced with an external link to any edition (e.g: [https://en.wikipedia.org/wiki/MediaWiki| Test]). I hope it's complete, I just ran into it by coincidence.

Event Timeline

Lofhi created this task.Apr 25 2020, 9:45 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptApr 25 2020, 9:45 PM
Lofhi updated the task description. (Show Details)Apr 25 2020, 9:46 PM
Lofhi updated the task description. (Show Details)
Lofhi updated the task description. (Show Details)Apr 25 2020, 9:48 PM
Fralambert rescinded a token.
Fralambert awarded a token.

Change 592727 had a related patch set uploaded (by Bartosz Dziewoński; owner: Bartosz Dziewoński):
[mediawiki/extensions/DiscussionTools@master] parser: Don't crash on links to invalid titles

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

Change 592727 merged by jenkins-bot:
[mediawiki/extensions/DiscussionTools@master] parser: Don't crash on links to invalid titles

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

Ryasmeen edited projects, added Verified; removed Editing QA.May 26 2020, 8:33 PM
ppelberg closed this task as Resolved.Jun 1 2020, 1:45 AM