Page MenuHomePhabricator

Reply button and notification permalink fail if the comment author contains + (plus) character
Closed, ResolvedPublicBUG REPORT

Description

Steps to replicate the issue:

  • Create account [[user:Test+]] (any username with + character – plus sign).
  • Log-in as Test+
  • Post a message mentioning another account you own.
  • Log in as your mentioned account.

What happens?:

  • The notification link contains “+” (plus) instead of “_” (underscore). (toast notification: “This comment could not be found on this page, but it does exist on the following page:”. The provided “following page” is still a broken link with same issue.)
  • The reply button for the message is also broken (error dialog: “Could not find the comment you're replying to on the page. It might have been deleted or moved to another page. Please reload the page and try again.”).

See real world issue.

What should have happened instead?:
The notification should be properly linked to the comment. The toast notification warning should not display.
The reply button should work properly.

Event Timeline

> MediaWiki\Extension\DiscussionTools\CommentUtils::getTitleFromUrl( "/wiki/User:T367977+T367977", MediaWiki\MediaWikiServices::getInstance()->getMainConfig() )
= "User:T367977 T367977"

Change #1047543 had a related patch set uploaded (by Bartosz Dziewoński; author: Bartosz Dziewoński):

[mediawiki/extensions/DiscussionTools@master] Fix parsing usernames with `+`

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

Change #1047543 merged by jenkins-bot:

[mediawiki/extensions/DiscussionTools@master] Fix parsing usernames with `+`

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

matmarex claimed this task.