Fixed parser error

Signed-off-by: Roland Häder <roland@mxchange.org>
This commit is contained in:
Roland Häder 2018-05-13 22:50:09 +02:00
parent debcdea82a
commit d0c7ba5257
No known key found for this signature in database
GPG key ID: B72F8185C6C7BD78

View file

@ -1978,18 +1978,22 @@ function protect_sprintf($s) {
return str_replace('%', '%%', $s); return str_replace('%', '%%', $s);
} }
/// @TODO Rewrite this
function is_a_date_arg($s) { function is_a_date_arg($s) {
$i = intval($s); $i = intval($s);
if ($i > 1900) { if ($i > 1900) {
$y = date('Y'); $y = date('Y');
if ($i <= $y + 1 && strpos($s, '-') == 4) { if ($i <= $y + 1 && strpos($s, '-') == 4) {
$m = intval(substr($s, 5)); $m = intval(substr($s, 5));
if ($m > 0 && $m <= 12) { if ($m > 0 && $m <= 12) {
return true; return true;
} }
} }
} }
return false; return false;
} }