r98881 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r98880‎ | r98881 | r98882 >
Date:18:53, 4 October 2011
Author:brion
Status:ok (Comments)
Tags:
Comment:
* (bug 31351) fix Quiz extension strict warning

patch by Rusty Burchfield, https://bugzilla.wikimedia.org/attachment.cgi?id=9155&action=diff
Modified paths:
  • /trunk/extensions/Quiz/Quiz.class.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Quiz/Quiz.class.php
@@ -132,7 +132,8 @@
133133 $head .= "</style>\n";
134134 global $wgJsMimeType, $wgScriptPath, $wgOut;
135135 # Determine the extension folder
136 - $folder = array_pop( explode( '/', dirname( __FILE__ ) ) );
 136+ $folderList = explode( '/', dirname( __FILE__ ) );
 137+ $folder = array_pop( $folderList );
137138 $folder = ( $folder == 'extensions' ) ? '' : "/$folder";
138139 $head .= "<script type=\"$wgJsMimeType\" src=\"$wgScriptPath/extensions$folder/quiz.js\"></script>\n";
139140 $wgOut->addScript( $head );

Follow-up revisions

RevisionCommit summaryAuthorDate
r98882MFT r98881 - bug 31351brion18:54, 4 October 2011
r98883MFT r98881 - bug 31351brion18:57, 4 October 2011

Comments

#Comment by 😂 (talk | contribs)   19:24, 4 October 2011

I'm actually more interested in why we're even doing this fragile path magic at all :)

#Comment by Brion VIBBER (talk | contribs)   19:49, 4 October 2011

It just looks like old code to allow the dir to have a couple different names (something we discourage these days), should probably get refactored to use ResourceLoader and $wgExtensionAssetsPath etc.

Status & tagging log