r78260 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r78259‎ | r78260 | r78261 >
Date:17:33, 12 December 2010
Author:ialex
Status:deferred
Tags:
Comment:
Use the "normal" way to get settings and request parameters instead of the horrible system in the MediaWiki class
Modified paths:
  • /trunk/extensions/InlineEditor/InlineEditor.class.php (modified) (history)
  • /trunk/extensions/InputBox/InputBox.hooks.php (modified) (history)
  • /trunk/extensions/Lockdown/Lockdown.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Lockdown/Lockdown.php
@@ -119,7 +119,7 @@
120120 function lockdownMediawikiPerformAction ( $output, $article, $title, $user, $request, $wiki ) {
121121 global $wgActionLockdown;
122122
123 - $action = $wiki->getVal( 'Action' );
 123+ $action = $request->getVal( 'action', 'view' );
124124
125125 if ( !isset( $wgActionLockdown[$action] ) ) return true;
126126
Index: trunk/extensions/InlineEditor/InlineEditor.class.php
@@ -19,10 +19,10 @@
2020 * Checks whether or not to spawn the editor, and does so if nessicary.
2121 */
2222 public static function mediaWikiPerformAction( $output, $article, $title, $user, $request, $wiki ) {
23 - global $wgHooks;
 23+ global $wgHooks, $wgDisabledActions;
2424
2525 // the action of the page, i.e. 'view' or 'edit'
26 - $action = $wiki->getVal( 'Action' );
 26+ $action = $request->getVal( 'action', 'view' );
2727
2828 // check if the editor could be used on this page, and if so, hide the [edit] links
2929 if ( self::isValidBrowser() && !self::isAdvancedPage( $article, $title ) ) {
@@ -30,7 +30,7 @@
3131 }
3232
3333 // return if the action is not 'edit' or if it's disabled
34 - if ( $action != 'edit' || in_array( $action, $wiki->getVal( 'DisabledActions', array() ) ) )
 34+ if ( $action != 'edit' || in_array( $action, $wgDisabledActions ) )
3535 {
3636 return true;
3737 }
Index: trunk/extensions/InputBox/InputBox.hooks.php
@@ -52,7 +52,7 @@
5353 $request,
5454 $wiki )
5555 {
56 - $action = $wiki->getVal( 'Action' );
 56+ $action = $request->getVal( 'action', 'view' );
5757 if( $action !== 'edit' ){
5858 # not our problem
5959 return true;

Follow-up revisions

RevisionCommit summaryAuthorDate
r78512Per ^demon, follow-up r78260: introduced MediaWiki::getAction() to get the ac...ialex20:11, 16 December 2010

Status & tagging log