From a7b286bfb6679a876c712bc08a0befecc6e8fe6f Mon Sep 17 00:00:00 2001 From: Alex Date: Wed, 8 Feb 2017 21:42:17 +0200 Subject: [PATCH] email validation --- app/library/App/Controllers/UserController.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/library/App/Controllers/UserController.php b/app/library/App/Controllers/UserController.php index 5d51532..9a476b3 100755 --- a/app/library/App/Controllers/UserController.php +++ b/app/library/App/Controllers/UserController.php @@ -123,11 +123,12 @@ class UserController extends CrudResourceController $data = $this->getPostedData(); - throw new Exception('777', $data[$email_field]); if (!isset($data[$email_field])) { $message = $validation->validate($data[$email_field]); + + throw new Exception('777', $message); if (count($message)) { throw new Exception(ErrorCodes::DATA_FAILED, 'Unable to create item', [ 'messages' => $message, -- libgit2 0.21.4