From 3f047b7509d0df9d2480fac8e7abad9b27876930 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Sun, 1 May 2005 02:39:54 +0000 Subject: [PATCH] * (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 --- includes/SkinTemplate.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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; -- 2.20.1