Page MenuHomePhabricator

autoConvert() should use StubObject::isRealObject() instead of isset() in LanguageConverter.php
Closed, ResolvedPublic

Description

Author: alexey.wmd

Description:
When the page is loaded from the cache, and autoConvert is called to convert the title, $wgParser is a StubObject so the check isset($wgParser) is always true. This produces wrong regexp that prevents latin characters conversion. Using StubObject::isRealObject() fixes this issue.


Version: 1.11.x
Severity: minor

Details

Reference
bz11751

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 9:59 PM
bzimport set Reference to bz11751.
bzimport added a subscriber: Unknown Object (MLST).

LanguageConverter.php.patch

Try to having this patch to resolving this issue.

Attached:

alefzet wrote:

Shouldn't fix this bug in SVN?

This patch is incorrect, it should use

if (StubObject::isRealObject($wgParser))

instead of

if (StubObject::isRealObject())

rainman wrote:

Extensions calling setHook() on wgParser will unstub it (e.g. by commonly used Cite extension), so that wouldn't work. I've commited a suboptimal patch that resolves the issue in r34537, so marking this as fixed.