diff options
author | jwacalex <aboehm@dompfaffenweg.de> | 2016-11-30 23:23:49 +0100 |
---|---|---|
committer | jwacalex <aboehm@dompfaffenweg.de> | 2016-11-30 23:23:49 +0100 |
commit | 45cda10479a16c237f917b69dc24ab3f31bffa89 (patch) | |
tree | 5aa98a6504d7558b56b7777f04b87a3b976bbedf /includes/sys_page.php | |
parent | 79b9f9448e4f3ad7abb8d795c1404b3221c95bf9 (diff) | |
parent | 53e12065c76af4e5a0a2690e92e6724eed9f2895 (diff) |
merged master and issue
Diffstat (limited to 'includes/sys_page.php')
-rw-r--r-- | includes/sys_page.php | 37 |
1 files changed, 2 insertions, 35 deletions
diff --git a/includes/sys_page.php b/includes/sys_page.php index ad4d15de..82ce9896 100644 --- a/includes/sys_page.php +++ b/includes/sys_page.php @@ -1,4 +1,5 @@ <?php +use Engelsystem\ValidationResult; /** * Provide page/request helper functions @@ -131,7 +132,7 @@ function check_request_date($name, $error_message = null, $null_allowed = false) * @return ValidationResult containing the parsed date */ function check_date($input, $error_message = null, $null_allowed = false) { - if ($tmp = parse_date("Y-m-d", trim($input))) { + if ($tmp = parse_date("Y-m-d H:i", trim($input) . " 00:00")) { return new ValidationResult(true, $tmp); } if ($null_allowed) { @@ -187,38 +188,4 @@ function check_email($email) { return (bool) filter_var($email, FILTER_VALIDATE_EMAIL); } -class ValidationResult { - - private $valid; - - private $value; - - /** - * Constructor. - * - * @param boolean $valid - * Is the value valid? - * @param * $value - * The validated value - */ - public function ValidationResult($valid, $value) { - $this->valid = $valid; - $this->value = $value; - } - - /** - * Is the value valid? - */ - public function isValid() { - return $this->valid; - } - - /** - * The parsed/validated value. - */ - public function getValue() { - return $this->value; - } -} - ?> |