MediaWiki r43592 - Code Review

Jump to: navigation, search
Repository:MediaWiki
Revision:r43591‎ | r43592 (on ViewVC)‎ | r43593 >
Date:02:33, 17 November 2008
Author:demon
Status:resolved (Comments)
Tags:
Comment:
Pass the user object in MakeGlobalVariablesScript in case some variables are user-dependent.
Modified paths:

Diff [purge]

Index: trunk/phase3/docs/hooks.txt
===================================================================
--- trunk/phase3/docs/hooks.txt	(revision 43591)
+++ trunk/phase3/docs/hooks.txt	(revision 43592)
@@ -889,6 +889,7 @@
 'MakeGlobalVariablesScript': called right before Skin::makeVariablesScript is executed   
 &$vars: variable (or multiple variables) to be added into the output   
 		of Skin::makeVariablesScript
+&$wgUser: user (object) currently loading the skin
 
 'MarkPatrolled': before an edit is marked patrolled
 $rcid: ID of the revision to be marked patrolled
Index: trunk/phase3/includes/Skin.php
===================================================================
--- trunk/phase3/includes/Skin.php	(revision 43591)
+++ trunk/phase3/includes/Skin.php	(revision 43592)
@@ -409,7 +409,7 @@
 			$vars['wgAjaxWatch'] = $msgs;
 		}
 
-		wfRunHooks('MakeGlobalVariablesScript', array(&$vars));
+		wfRunHooks('MakeGlobalVariablesScript', array( &$vars, &$wgUser ) );
 
 		return self::makeVariablesScript( $vars );
 	}

Follow-up revisions

Rev.Commit summaryAuthorDate
r43632Revert r43592 "Pass the user object in MakeGlobalVariablesScript in case some...brion20:04, 17 November 2008

Comments

#Comment by Brion VIBBER (Talk | contribs)   20:05, 17 November 2008

As a UI thingy, $wgUser will be the only relevant user object here; there's no circumstance in which we might pass some other user object. No reason to pass it to hooks just on the off chance that they might use it, then...

Reverted in r43632

Status & tagging log

Personal tools
Namespaces
Variants
Views
Actions
Site
Support
Download
Development
Communication
Toolbox