r8766 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r8765‎ | r8766 | r8767 >
Date:02:39, 1 May 2005
Author:vibber
Status:old
Tags:
Comment:
* (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
Modified paths:
  • /trunk/phase3/includes/SkinTemplate.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/SkinTemplate.php
@@ -939,7 +939,14 @@
940940 $s = '/* generated javascript */';
941941 $s .= "var skin = '{$this->skinname}';\nvar stylepath = '{$wgStylePath}';";
942942 $s .= '/* MediaWiki:'.ucfirst($this->skinname)." */\n";
943 - $s .= wfMsg(ucfirst($this->skinname).'.js');
 943+
 944+ // avoid inclusion of non defined user JavaScript (with custom skins only)
 945+ // by checking for default message content
 946+ $msgKey = ucfirst($this->skinname).'.js';
 947+ $userJS = wfMsg($msgKey);
 948+ if ('<'.$msgKey.'>' != $userJS) {
 949+ $s .= $userJS;
 950+ }
944951
945952 wfProfileOut( $fname );
946953 return $s;

Follow-up revisions

RevisionCommit summaryAuthorDate
r8767* (bug 2024) JavaScript error for custom skins...vibber02:42, 1 May 2005

Status & tagging log