diff --git a/includes/SpecialNuke.php b/includes/SpecialNuke.php index afaee8e8..5119e3da 100644 --- a/includes/SpecialNuke.php +++ b/includes/SpecialNuke.php @@ -343,6 +343,7 @@ class SpecialNuke extends SpecialPage { */ protected function doDelete( array $pages, $reason ) { $res = []; + $user = $this->getUser(); $services = MediaWikiServices::getInstance(); $localRepo = $services->getRepoGroup()->getLocalRepo(); @@ -360,14 +361,13 @@ class SpecialNuke extends SpecialPage { continue; } - $user = $this->getUser(); - $file = $title->getNamespace() === NS_FILE ? $localRepo->newFile( $title ) : false; $permission_errors = $permissionManager->getPermissionErrors( 'delete', $user, $title ); if ( $permission_errors !== [] ) { throw new PermissionsError( 'delete', $permission_errors ); } + $file = $title->getNamespace() === NS_FILE ? wfLocalFile( $title ) : false; if ( $file ) { $oldimage = null; // Must be passed by reference $status = FileDeleteForm::doDelete( @@ -390,8 +390,11 @@ class SpecialNuke extends SpecialPage { } } - $this->getOutput()->addHTML( "\n" ); + $this->getOutput()->addHTML( + "\n" + ); $this->getOutput()->addWikiMsg( 'nuke-delete-more' ); }