mirror of
https://github.com/opensupports/opensupports.git
synced 2025-07-24 22:35:43 +02:00
fix date range validation on php 7.2
This commit is contained in:
parent
8be43bb7ea
commit
cc9c51b856
@ -8,9 +8,8 @@ class ValidDateRange extends AbstractRule {
|
|||||||
|
|
||||||
public function validate($dateRange) {
|
public function validate($dateRange) {
|
||||||
$dateArray = json_decode($dateRange);
|
$dateArray = json_decode($dateRange);
|
||||||
$length = count($dateArray);
|
|
||||||
|
if(is_array($dateArray) && count($dateArray) == 2 ){
|
||||||
if(is_array($dateArray) && $length == 2 ){
|
|
||||||
foreach ($dateArray as $date) {
|
foreach ($dateArray as $date) {
|
||||||
if (!is_numeric($date)) return false;
|
if (!is_numeric($date)) return false;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user