Page MenuHomePhabricator

Translate error validator gets confused if there are pre tags in the content
Closed, ResolvedPublic1 Estimated Story PointsBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

  • Try to save a page with the (invalid) wikitext <translate><pre></pre>{{Foo}}

What happens?:

The error escapes from the code block in the translate tags and gets interpreted as wikitext.

image.png (267×1 px, 23 KB)

What should have happened instead?:

Not that.

image.png (243×1 px, 23 KB)

Software version (on Special:Version page; skip for WMF-hosted wikis like Wikipedia):

Other information (browser name/version, screenshots, etc.):

Probably not at all worth fixing, but filing for the record anyway. Discovered while investigating T379808

Event Timeline

This also happens if there are pre tags in the page anywhere before the error - the error doesn't have to involve them.

Change #1091877 had a related patch set uploaded (by Tacsipacsi; author: Tacsipacsi):

[mediawiki/extensions/Translate@master] Escape the translation template in error messages

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

Tacsipacsi subscribed.

Escaping issues are always worth fixing, because they can quickly turn into vulnerabilities (even though I don’t know if this one can actually be exploited).

Change #1091877 merged by jenkins-bot:

[mediawiki/extensions/Translate@master] Escape the translation template in error messages

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

abi_ subscribed.

Fixed on translatewiki.net

image.png (396×1 px, 37 KB)