diff --git a/src/applications/phriction/controller/PhrictionEditController.php b/src/applications/phriction/controller/PhrictionEditController.php index 79b9188681..9e7c351417 100644 --- a/src/applications/phriction/controller/PhrictionEditController.php +++ b/src/applications/phriction/controller/PhrictionEditController.php @@ -130,6 +130,19 @@ final class PhrictionEditController return id(new AphrontDialogResponse())->setDialog($dialog); } + } else if (!strlen($request->getStr('content'))) { + + // We trigger this only for new pages. For existing pages, deleting + // all the content counts as deleting the page. + + $dialog = new AphrontDialogView(); + $dialog->setUser($user); + $dialog->setTitle('Empty Page'); + $dialog->appendChild( + '
You can not create an empty document.
'); + $dialog->addCancelButton($request->getRequestURI()); + + return id(new AphrontDialogResponse())->setDialog($dialog); } if (!count($errors)) {