Page MenuHomePhabricator

Links with attributes containing escaped right square brackets don't close properly
Closed, ResolvedPublic

Description

In this wikitext:

*hello [[Example|<span title="&#91;&#91;abc&#93;&#93;">convert: invalid number</span>]] world
*The following link [[The End]] stops the link from the previous line!

The </a> ends up inside the title attribute, where it (obviously) doesn't work. This makes the link extend up until the next link instead of ending where it should.

Originally reported at https://en.wikipedia.org/w/index.php?diff=625356218


Version: 1.24rc
Severity: normal

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 3:45 AM
bzimport added a project: MediaWiki-Parser.
bzimport set Reference to bz70875.
bzimport added a subscriber: Unknown Object (MLST).
Fomafix subscribed.

T51672 are external links and T72875 are internal links. https://gerrit.wikimedia.org/r/391135 solve both but they are separate test cases.

Change 391135 had a related patch set uploaded (by Fomafix; owner: MaxSem):
[mediawiki/core@master] Sanitizer::safeEncodeAttribute(): also encode ]

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

Change 391135 merged by jenkins-bot:
[mediawiki/core@master] Sanitizer::safeEncodeAttribute(): also encode ]

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

Fomafix assigned this task to MaxSem.
Fomafix removed a project: Patch-For-Review.