r113793 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r113792‎ | r113793 | r113794 >
Date:01:58, 14 March 2012
Author:saper
Status:reverted (Comments)
Tags:gerritmigration 
Comment:
(bug 35214) Special:Nuke allows deletions even when blocked
Modified paths:
  • /trunk/extensions/Nuke/Nuke_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Nuke/Nuke_body.php
@@ -7,14 +7,18 @@
88 }
99
1010 public function execute( $par ) {
11 - if( !$this->userCanExecute( $this->getUser() ) ) {
 11+ if ( !$this->userCanExecute( $this->getUser() ) ) {
1212 $this->displayRestrictionError();
13 - return;
1413 }
15 -
1614 $this->setHeaders();
1715 $this->outputHeader();
1816
 17+ if ( $this->getUser()->isBlocked() ) {
 18+ $block = $this->getUser()->getBlock();
 19+ throw new UserBlockedError( $block );
 20+ }
 21+ $this->checkReadOnly();
 22+
1923 $req = $this->getRequest();
2024
2125 $target = trim( $req->getText( 'target', $par ) );
@@ -286,6 +290,12 @@
287291 $title = Title::newFromURL( $page );
288292 $file = $title->getNamespace() == NS_FILE ? wfLocalFile( $title ) : false;
289293
 294+ $permission_errors = $title->getUserPermissionsErrors( 'delete', $this->getUser());
 295+
 296+ if ( count( $permission_errors )) {
 297+ throw new PermissionsError( 'delete', $permission_errors );
 298+ }
 299+
290300 if ( $file ) {
291301 $oldimage = null; // Must be passed by reference
292302 $ok = FileDeleteForm::doDelete( $title, $file, $oldimage, $reason, false )->isOK();

Follow-up revisions

RevisionCommit summaryAuthorDate
r113795Followup-To: r113793 Update RELEASE-NOTES for Extension:Nuke version 1.1.5saper02:24, 14 March 2012
r114394Revert r113364, r113598, r113604, r113793, r113795. Unreviewed changes in Nuke....catrope19:25, 21 March 2012

Comments

#Comment by Saper (talk | contribs)   02:00, 14 March 2012

This is a quick fix. Will be converting to FormSpecialPage.

Status & tagging log