summaryrefslogtreecommitdiff
path: root/includes/sys_page.php
diff options
context:
space:
mode:
authormsquare <msquare@notrademark.de>2016-09-29 11:28:42 +0200
committermsquare <msquare@notrademark.de>2016-09-29 11:28:42 +0200
commit4c288e957ec4340af93f980c65eecea6d3a789f4 (patch)
treea438607b5a1974e86a7fdd6f5da50db6e5356c1c /includes/sys_page.php
parente965f8d04150fbd17ee1b5fcbca5ae85bbe6d6bd (diff)
prohibit inline control structures on includes and index
Diffstat (limited to 'includes/sys_page.php')
-rw-r--r--includes/sys_page.php9
1 files changed, 6 insertions, 3 deletions
diff --git a/includes/sys_page.php b/includes/sys_page.php
index cbc18db8..6b71eb15 100644
--- a/includes/sys_page.php
+++ b/includes/sys_page.php
@@ -31,8 +31,9 @@ function raw_output($output) {
* @return ValidationResult containing the parsed date
*/
function check_request_date($name, $error_message = null, $null_allowed = false) {
- if (! isset($_REQUEST[$name]))
+ if (! isset($_REQUEST[$name])) {
return new ValidationResult($null_allowed, null);
+ }
return check_date($_REQUEST[$name], $error_message, $null_allowed);
}
@@ -49,10 +50,12 @@ 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 (DateTime::createFromFormat("Y-m-d", trim($input)))
+ if (DateTime::createFromFormat("Y-m-d", trim($input))) {
return new ValidationResult(true, DateTime::createFromFormat("Y-m-d", trim($input))->getTimestamp());
- if ($null_allowed)
+ }
+ if ($null_allowed) {
return new ValidationResult(true, null);
+ }
error($error_message);
return new ValidationResult(false, null);