From: Brion Vibber Date: Sun, 1 May 2005 02:39:54 +0000 (+0000) Subject: * (bug 2024) JavaScript error for custom skins X-Git-Tag: 1.5.0alpha1~46 X-Git-Url: https://git.cyclocoop.org/%28%28?a=commitdiff_plain;h=3f047b7509d0df9d2480fac8e7abad9b27876930;p=lhc%2Fweb%2Fwiklou.git * (bug 2024) JavaScript error for custom skins Don't include the skinname.js message if it's not set for this skin. Patch from Michael Keppler: http://bugzilla.wikipedia.org/attachment.cgi?id=483 --- diff --git a/includes/SkinTemplate.php b/includes/SkinTemplate.php index edd4975043..9e346013e0 100644 --- a/includes/SkinTemplate.php +++ b/includes/SkinTemplate.php @@ -939,7 +939,14 @@ class SkinTemplate extends Skin { $s = '/* generated javascript */'; $s .= "var skin = '{$this->skinname}';\nvar stylepath = '{$wgStylePath}';"; $s .= '/* MediaWiki:'.ucfirst($this->skinname)." */\n"; - $s .= wfMsg(ucfirst($this->skinname).'.js'); + + // avoid inclusion of non defined user JavaScript (with custom skins only) + // by checking for default message content + $msgKey = ucfirst($this->skinname).'.js'; + $userJS = wfMsg($msgKey); + if ('<'.$msgKey.'>' != $userJS) { + $s .= $userJS; + } wfProfileOut( $fname ); return $s;