diff --git a/src/application/controller/api/post/add.php b/src/application/controller/api/post/add.php index 43e5074..b514911 100644 --- a/src/application/controller/api/post/add.php +++ b/src/application/controller/api/post/add.php @@ -17,10 +17,16 @@ if (isset($_SESSION['userName'])) { } } + if (!isset($_POST['message'])) { - if ($postK && $result = $_twister->newPostMessage($_SESSION['userName'], - $postK, - Filter::post($_POST['message']))) { + $response = [ + 'success' => false, + 'message' => _('Message required') + ]; + + } else if ($postK && $result = $_twister->newPostMessage($_SESSION['userName'], + $postK, + Filter::post($_POST['message']))) { $response = [ 'success' => true,