From: Jens Frank Date: Thu, 5 Aug 2004 04:30:29 +0000 (+0000) Subject: Don't allow reverting of images if the image page is protected. Fixes BUG 996920. X-Git-Tag: 1.5.0alpha1~2514 X-Git-Url: https://git.cyclocoop.org/%28%28?a=commitdiff_plain;h=2892f4106885b033afb7735f1ae0aee964b2c1e6;p=lhc%2Fweb%2Fwiklou.git Don't allow reverting of images if the image page is protected. Fixes BUG 996920. --- diff --git a/includes/ImagePage.php b/includes/ImagePage.php index d06f06a8f8..0394473c7f 100644 --- a/includes/ImagePage.php +++ b/includes/ImagePage.php @@ -261,6 +261,10 @@ class ImagePage extends Article { $wgOut->readOnlyPage(); return; } + if ( ! $this->mTitle->userCanEdit() ) { + $wgOut->sysopRequired(); + return; + } $name = substr( $oldimage, 15 ); $dest = wfImageDir( $name ); diff --git a/includes/Skin.php b/includes/Skin.php index d7119e3c06..dbff5d63b2 100644 --- a/includes/Skin.php +++ b/includes/Skin.php @@ -2533,7 +2533,7 @@ class Skin { } } else { $url = wfEscapeHTML( wfImageArchiveUrl( $img ) ); - if( $wgUser->getID() != 0 ) { + if( $wgUser->getID() != 0 && $wgTitle->userCanEdit() ) { $rlink = $this->makeKnownLink( $wgTitle->getPrefixedText(), wfMsg( 'revertimg' ), 'action=revert&oldimage=' . urlencode( $img ) );