[Actions] Update usage of wgDisabledActions to check wgActions instead
authorKrinkle <krinkle@users.mediawiki.org>
Sun, 5 Feb 2012 13:30:24 +0000 (13:30 +0000)
committerKrinkle <krinkle@users.mediawiki.org>
Sun, 5 Feb 2012 13:30:24 +0000 (13:30 +0000)
* Setup.php adds any values in the deprecated wgDisabledActions to wgActions in the new format. So checking wgDisabledActions is actually insufficient, not just deprecated.

* Poke r86041

includes/Action.php

index a5bcb05..66947ab 100644 (file)
@@ -89,20 +89,20 @@ abstract class Action {
        /**
         * Get the action that will be executed, not necessarily the one passed
         * passed through the "action" request parameter. Actions disabled in
-        * $wgDisabledActions will be replaced by "nosuchaction".
+        * $wgActions will be replaced by "nosuchaction".
         *
         * @since 1.19
         * @param $context IContextSource
         * @return string: action name
         */
        public final static function getActionName( IContextSource $context ) {
-               global $wgDisabledActions;
+               global $wgActions;
 
                $request = $context->getRequest();
                $actionName = $request->getVal( 'action', 'view' );
 
                // Check for disabled actions
-               if ( in_array( $actionName, $wgDisabledActions ) ) {
+               if ( isset( $wgActions[$actionName] ) && $wgActions[$actionName] === false ) {
                        $actionName = 'nosuchaction';
                }