Skip to content

Commit da62677

Browse files
committedApr 7, 2016
Allow numerics for unix timestamps.
1 parent 05367bc commit da62677

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed
 

‎src/Illuminate/Validation/Validator.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -1383,7 +1383,7 @@ protected function validateDate($attribute, $value)
13831383
return true;
13841384
}
13851385

1386-
if (! is_string($value) || strtotime($value) === false) {
1386+
if ((! is_string($value) && ! is_numeric($value)) || strtotime($value) === false) {
13871387
return false;
13881388
}
13891389

@@ -1404,7 +1404,7 @@ protected function validateDateFormat($attribute, $value, $parameters)
14041404
{
14051405
$this->requireParameterCount(1, $parameters, 'date_format');
14061406

1407-
if (! is_string($value)) {
1407+
if (! is_string($value) && ! is_numeric($value)) {
14081408
return false;
14091409
}
14101410

@@ -1425,7 +1425,7 @@ protected function validateBefore($attribute, $value, $parameters)
14251425
{
14261426
$this->requireParameterCount(1, $parameters, 'before');
14271427

1428-
if (! is_string($value)) {
1428+
if (! is_string($value) && ! is_numeric($value)) {
14291429
return false;
14301430
}
14311431

@@ -1467,7 +1467,7 @@ protected function validateAfter($attribute, $value, $parameters)
14671467
{
14681468
$this->requireParameterCount(1, $parameters, 'after');
14691469

1470-
if (! is_string($value)) {
1470+
if (! is_string($value) && ! is_numeric($value)) {
14711471
return false;
14721472
}
14731473

0 commit comments

Comments
 (0)
Please sign in to comment.