From 35947befc1a80d92452272266a85d593c5f9acf8 Mon Sep 17 00:00:00 2001 From: Gregorio Chiko Putra Date: Wed, 6 Sep 2017 14:17:09 +0700 Subject: [PATCH] Cannot input empty data to posts --- App/Controllers/Posts.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/App/Controllers/Posts.php b/App/Controllers/Posts.php index 23d49c9..cbe08b3 100644 --- a/App/Controllers/Posts.php +++ b/App/Controllers/Posts.php @@ -156,6 +156,13 @@ class Posts unset($args['_addon']); } + foreach ($args as $value) { + if ($value == '') { + Session::flash('info', 'All data must not be empty'); + Redirect::to('./entry'); + } + } + if ($this->post->entry($table, $args)) { Session::flash('info', 'Data successfuly uploaded');