Page MenuHomePhabricator

Error on Special:Version in multiscript wiki
Closed, ResolvedPublic

Description

Author: alefzet

Description:
Environment:
Windows XP SP2
XAMPP 1.6.2
$wgLanguageCode = "kk"; ## or sr, zh with multiscript enabled
wgUserLanguage = "kk"; #

Trying go to link Special:Version causes error:
'Catchable fatal error: Object of class KkConverter could not be converted to string in C:\xampplite\htdocs\w\includes\SpecialVersion.php on line 241'
where KkConverter may be SrConverter or ZhConverter if you specify sr or zh

When user language changed for example to en, we have same error.

On Betawiki (http://nike.users.idler.fi/betawiki) if user language in Preferences set to kk, Special:Version generates error:
'Catchable fatal error: Object of class KkConverter could not be converted to string in /home/nike/public_html/dev/includes/SpecialVersion.php on line 243'

When user language changed for example to en, we have page as expected.

Both happense around function listToText()


Version: 1.11.x
Severity: critical
OS: Windows XP
Platform: PC

Details

Reference
bz10083

Event Timeline

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

Ok, figured this one out at last...

The language converter modes are adding an ArticleSaveComplete hook using a weird format that I don't particuarly like; it's adding _just_ the object to the hooks array, and I guess it's calling a function based on the hook name.

The Special:Version code which lists the installed hooks doesn't properly handle this case in SpecialVersion::arrayToString(), so the object is passed up another level and interpolated directly into a string.

In PHP 5.1 this simply turns into something like "Object id #17".

In PHP 5.2, this seems to trigger a catchable, but uncaught, fatal error.
Since we've still got 5.1 on the live servers, nobody noticed it there before. :)

Fixed in r22630