Changing the skin loader to load classes using the pattern "Skin{$skinName}" instead...
authorDaniel Friesen <dantman@users.mediawiki.org>
Sun, 26 Dec 2010 14:15:27 +0000 (14:15 +0000)
committerDaniel Friesen <dantman@users.mediawiki.org>
Sun, 26 Dec 2010 14:15:27 +0000 (14:15 +0000)
commit442359e48992d87c02eae3b97bf1c5954745cf42
treeb350fbba890ceddab3485b74ce3ef55f824cb3ca
parent15c26d343ba975bec4688e31bbf6ecc7d721028a
Changing the skin loader to load classes using the pattern "Skin{$skinName}" instead of `"Skin" . ucfirst($key)` as the current behavior has been causing bugs with extension based skins attempting to use the autoloader to load their skins.
Under current behavior for "MonoBook" the skin loader will load "SkinMonobook" instead of "SkinMonoBook". Because the skin system loads from skins/ when it can't find a skin and php's class system is case insensitive by a fluke MonoBook has been fine despite the skin loader trying to load SkinMonobook despite the class being named SkinMonoBook.
However our autoloader is case-sensitive, and as a result if you try to name your extension based skin class something like SkinStereoBook the skin will break with a cryptic error message because the skin loader attempts to load SkinStereobook, doesn't find it in the autoloader, then throws a php error when it tries to load skins/StereoBook.php and can't find the file.
We have also been using the $skinName to generate the name of the file to load from skins/ so this value is already expected to be safe for use in this way.
RELEASE-NOTES
includes/DefaultSettings.php
includes/Skin.php