From ff0778a54bdd21186dcb5094643db5bc1fe2a7a6 Mon Sep 17 00:00:00 2001 From: rGaillard Date: Mon, 29 Oct 2012 11:32:35 +0000 Subject: [PATCH] [-] FO: Fix #PSCFV-5220 exception when birthday date is invalid --- controllers/front/AuthController.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/controllers/front/AuthController.php b/controllers/front/AuthController.php index e1bc64ba3..5a6bed7ec 100644 --- a/controllers/front/AuthController.php +++ b/controllers/front/AuthController.php @@ -399,6 +399,8 @@ class AuthControllerCore extends FrontController if (Tools::isSubmit('newsletter')) $this->processCustomerNewsletter($customer); $customer->birthday = (empty($_POST['years']) ? '' : (int)$_POST['years'].'-'.(int)$_POST['months'].'-'.(int)$_POST['days']); + if (!Validate::isBirthDate($customer->birthday)) + $this->errors[] = Tools::displayError('Invalid birthday.'); $customer->active = 1; // New Guest customer if (Tools::isSubmit('is_new_customer')) @@ -498,7 +500,9 @@ class AuthControllerCore extends FrontController $this->processCustomerNewsletter($customer); $customer->birthday = (empty($_POST['years']) ? '' : (int)$_POST['years'].'-'.(int)$_POST['months'].'-'.(int)$_POST['days']); - + if (!Validate::isBirthDate($customer->birthday)) + $this->errors[] = Tools::displayError('Invalid birthday.'); + if (!count($this->errors)) { // if registration type is in one step, we save the address