Index: trunk/extensions/FlaggedRevs/FlaggedRevs.php |
— | — | @@ -793,7 +793,11 @@ |
794 | 794 | |
795 | 795 | if( !$wgArticle || !$wgArticle->exists() || !$wgArticle->mTitle->isContentPage() || $action !='view' ) |
796 | 796 | return; |
797 | | - |
| 797 | + // Check if page is protected |
| 798 | + if( !$wgArticle->mTitle->quickUserCan( 'edit' ) ) { |
| 799 | + return; |
| 800 | + } |
| 801 | + // Get revision ID |
798 | 802 | $revId = ( $wgArticle->mRevision ) ? $wgArticle->mRevision->mId : $wgArticle->getLatest(); |
799 | 803 | // We cannot review deleted revisions |
800 | 804 | if( is_object($wgArticle->mRevision) && $wgArticle->mRevision->mDeleted ) |
Index: trunk/extensions/FlaggedRevs/FlaggedRevsPage.body.php |
— | — | @@ -25,7 +25,6 @@ |
26 | 26 | $this->target = $wgRequest->getText( 'target' ); |
27 | 27 | // Revision ID |
28 | 28 | $this->oldid = $wgRequest->getIntOrNull( 'oldid' ); |
29 | | - |
30 | 29 | // Must be a valid content page |
31 | 30 | $this->page = Title::newFromUrl( $this->target ); |
32 | 31 | if ( !$this->target || !$this->oldid || !$this->page->isContentPage() ) { |
— | — | @@ -36,6 +35,11 @@ |
37 | 36 | $wgOut->showErrorPage('notargettitle', 'notargettext' ); |
38 | 37 | return; |
39 | 38 | } |
| 39 | + // Check if page is protected |
| 40 | + if( !$this->page->quickUserCan( 'edit' ) ) { |
| 41 | + $wgOut->permissionRequired( 'badaccess-group0' ); |
| 42 | + return; |
| 43 | + } |
40 | 44 | // Special parameter mapping |
41 | 45 | $this->templateParams = $wgRequest->getVal( 'templateParams' ); |
42 | 46 | $this->imageParams = $wgRequest->getVal( 'imageParams' ); |