+ /**
+ * Returns the action that will be executed, not necesserly the one passed
+ * passed through the "action" parameter. Actions disabled in
+ * $wgDisabledActions will be replaced by "nosuchaction"
+ *
+ * @param $request WebRequest
+ * @return String: action
+ */
+ public function getAction( WebRequest $request ) {
+ global $wgDisabledActions;
+
+ $action = $request->getVal( 'action', 'view' );
+
+ // Check for disabled actions
+ if( in_array( $action, $wgDisabledActions ) ) {
+ return 'nosuchaction';
+ }
+
+ // Workaround for bug #20966: inability of IE to provide an action dependent
+ // on which submit button is clicked.
+ if ( $action === 'historysubmit' ) {
+ if ( $request->getBool( 'revisiondelete' ) ) {
+ return 'revisiondelete';
+ } elseif ( $request->getBool( 'revisionmove' ) ) {
+ return 'revisionmove';
+ } else {
+ return 'view';
+ }
+ } elseif ( $action == 'editredlink' ) {
+ return 'edit';
+ }
+
+ return $action;
+ }
+