Skip to content

Commit 2f9c981

Browse files
AnhNhanepriestley
authored andcommitted
Oversight: Prevent deletion/movement of stub pages
Summary: Refs T2686 - Now you also can't delete / move stubbed pages Test Plan: tried it out - works wonderful Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Maniphest Tasks: T2686 Differential Revision: https://secure.phabricator.com/D5341
1 parent 76ed21d commit 2f9c981

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

src/applications/phriction/controller/PhrictionDeleteController.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ public function processRequest() {
2525
$disallowed_states = array(
2626
PhrictionDocumentStatus::STATUS_DELETED, // Stupid
2727
PhrictionDocumentStatus::STATUS_MOVED, // Makes no sense
28+
PhrictionDocumentStatus::STATUS_STUB, // How could they?
2829
);
2930
if (in_array($document->getStatus(), $disallowed_states)) {
3031
$e_text = pht('An already moved or deleted document can not be deleted');

src/applications/phriction/controller/PhrictionMoveController.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ public function processRequest() {
5353
$disallowed_statuses = array(
5454
PhrictionDocumentStatus::STATUS_DELETED, // Stupid
5555
PhrictionDocumentStatus::STATUS_MOVED, // Plain stupid
56+
PhrictionDocumentStatus::STATUS_STUB, // Utterly stupid
5657
);
5758
if (in_array($document->getStatus(), $disallowed_statuses)) {
5859
$error_view = new AphrontErrorView();

0 commit comments

Comments
 (0)