From 2892f4106885b033afb7735f1ae0aee964b2c1e6 Mon Sep 17 00:00:00 2001 From: Jens Frank Date: Thu, 5 Aug 2004 04:30:29 +0000 Subject: [PATCH] Don't allow reverting of images if the image page is protected. Fixes BUG 996920. --- includes/ImagePage.php | 4 ++++ includes/Skin.php | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) 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 ) ); -- 2.20.1