* (bug 2656) Fix regression: prevent blocked users from reverting images
authorBrion Vibber <brion@users.mediawiki.org>
Fri, 1 Jul 2005 21:15:31 +0000 (21:15 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Fri, 1 Jul 2005 21:15:31 +0000 (21:15 +0000)
RELEASE-NOTES
includes/ImagePage.php

index bb7e014..b215a10 100644 (file)
@@ -439,6 +439,7 @@ Various bugfixes, small features, and a few experimental things:
   recentchanges should specify current ID explicitly.
 * (bug 2609) Fix text justification preferenced with MonoBook skin.
 * (bug 2594) Display article tab as red for non-existent articles.
+* (bug 2656) Fix regression: prevent blocked users from reverting images
 
 === Caveats ===
 
index ec39f31..600fc22 100644 (file)
@@ -344,6 +344,9 @@ class ImagePage extends Article {
                        $wgOut->sysopRequired();
                        return;
                }
+               if ( $wgUser->isBlocked() ) {
+                       return $this->blockedIPpage();
+               }
                if ( wfReadOnly() ) {
                        $wgOut->readOnlyPage();
                        return;
@@ -526,6 +529,9 @@ class ImagePage extends Article {
                        $wgOut->sysopRequired();
                        return;
                }
+               if ( $wgUser->isBlocked() ) {
+                       return $this->blockedIPpage();
+               }
                if( !$wgUser->matchEditToken( $wgRequest->getVal( 'wpEditToken' ), $oldimage ) ) {
                        $wgOut->errorpage( 'internalerror', 'sessionfailure' );
                        return;
@@ -564,6 +570,13 @@ class ImagePage extends Article {
                $descTitle = $img->getTitle();
                $wgOut->returnToMain( false, $descTitle->getPrefixedText() );
        }
+       
+       function blockedIPpage() {
+               require_once( 'EditPage.php' );
+               $edit = new EditPage( $this );
+               return $edit->blockedIPpage();
+       }
+
 }
 
 /**