diff --git a/core/controller/controller.php b/core/controller/controller.php index 2f33bac..5eb13a5 100644 --- a/core/controller/controller.php +++ b/core/controller/controller.php @@ -332,6 +332,11 @@ class Controller $request->session()->clean('page'); return $result; } + + function redirect($action) { + header('location: ' . $this->fUrl($action)); + exit(); + } } class Controller_Action extends Controller {} diff --git a/core/mail.php b/core/mail.php index e377c90..53fa161 100644 --- a/core/mail.php +++ b/core/mail.php @@ -193,10 +193,10 @@ class Mail function send() { $result = mail($this->to, $this->getSubject(), $this->getMessage(), $this->getHeader()); -// $result = false; if(! $result) { - require_once "core/path.php"; - file_put_contents(Path::resolveFile("data/email/send.eml"), $this->eml()); + throw new Exception('Невозможно отправить почту'); +// require_once "core/path.php"; +// file_put_contents(Path::resolveFile("data/email/send.eml"), $this->eml()); } return $result; } diff --git a/core/validator/validator.php b/core/validator/validator.php index 10a30d6..4aa9d7f 100644 --- a/core/validator/validator.php +++ b/core/validator/validator.php @@ -41,7 +41,8 @@ class Validator // Формат правила 'rule1|rule2,param1=value1|rule3,param1=value1,param2=value2' foreach ($input as $value) { // Список правил - if (! isset($value['validate'])) continue; + if (!isset($value['validate']) || $value['validate'] == '') continue; + $rules = explode("|", $value['validate']); foreach ($rules as $rule) { // Список параметров правила @@ -61,7 +62,7 @@ class Validator } $this->addRule($rule); } else { - throw new Exception('Unknown validation rule ' . $name); + throw new Exception('Unknown validation rule "' . $rule . "'"); } } }