Use a separate redlink parameter for red link determination, instead of overloading...
authorTim Starling <tstarling@users.mediawiki.org>
Tue, 26 Feb 2008 06:10:24 +0000 (06:10 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Tue, 26 Feb 2008 06:10:24 +0000 (06:10 +0000)
includes/EditPage.php
includes/Linker.php

index 2bb9e72..1a3eae7 100644 (file)
@@ -394,10 +394,6 @@ class EditPage {
                        wfProfileOut( __METHOD__ );
                        return;
                } else {
-                       if( $wgRequest->getVal( 'action' ) == 'editredlink' ) {
-                               $wgOut->redirect( $this->mTitle->getFullUrl( 'action=edit' ) );
-                               return;
-                       }
                        if ( $this->save ) {
                                $this->formtype = 'save';
                        } else if ( $this->preview ) {
@@ -485,11 +481,11 @@ class EditPage {
        /**
         * Show a read-only error
         * Parameters are the same as OutputPage:readOnlyPage()
-        * Redirect to the article page if action=editredlink
+        * Redirect to the article page if redlink=1
         */
        function readOnlyPage( $source = null, $protected = false, $reasons = array() ) {
                global $wgRequest, $wgOut;
-               if ( $wgRequest->getVal( 'action' ) === 'editredlink' ) {
+               if ( $wgRequest->getBool( 'redlink' ) ) {
                        // The edit page was reached via a red link.
                        // Redirect to the article page and let them click the edit tab if 
                        // they really want a permission error.
index 4f27d65..f1ae634 100644 (file)
@@ -344,9 +344,9 @@ class Linker {
                if( $nt->getNamespace() == NS_SPECIAL ) {
                        $q = $query;
                } else if ( '' == $query ) {
-                       $q = 'action=editredlink';
+                       $q = 'action=edit&redlink=1';
                } else {
-                       $q = 'action=editredlink&'.$query;
+                       $q = 'action=edit&redlink=1&'.$query;
                }
                $u = $nt->escapeLocalURL( $q );