Page MenuHomePhabricator

T132926-master.patch

Authored By
Bawolff
Aug 1 2016, 12:12 PM
Size
1 KB
Referenced Files
None
Subscribers
None

T132926-master.patch

From ab873c48f13e8e7976b9a794fa43b21e7c031b37 Mon Sep 17 00:00:00 2001
From: Brian Wolff <bawolff+wn@gmail.com>
Date: Mon, 18 Apr 2016 12:45:56 -0400
Subject: [PATCH] Do not allow undeleting a revdel'd file if its top file
This prevents admins being able to view suppressed files, by simply
deleting them, and then undeleting only the file revision that they
want to view.
This dates back to r43288. Unclear if it was intentional.
Bug: T132926
Change-Id: Ib767de853a37099305db20529378fa756ee1bdfe
---
includes/filerepo/file/LocalFile.php | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/includes/filerepo/file/LocalFile.php b/includes/filerepo/file/LocalFile.php
index e35af75..ef4e21e 100644
--- a/includes/filerepo/file/LocalFile.php
+++ b/includes/filerepo/file/LocalFile.php
@@ -2539,8 +2539,9 @@ class LocalFileRestoreBatch {
// The live (current) version cannot be hidden!
if ( !$this->unsuppress && $row->fa_deleted ) {
- $storeBatch[] = [ $deletedUrl, 'public', $destRel ];
- $this->cleanupBatch[] = $row->fa_storage_key;
+ $status->fatal( 'undeleterevdel' );
+ $this->file->unlock();
+ return $status;
}
} else {
$archiveName = $row->fa_archive_name;
--
1.9.5 (Apple Git-50.3)

File Metadata

Mime Type
text/x-diff
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3896742
Default Alt Text
T132926-master.patch (1 KB)

Event Timeline