Skip to content

Commit

Permalink
[5.2] Fix return type of some validation methods (#14373)
Browse files Browse the repository at this point in the history
* Fix return type of some validation methods

* Use > 0
  • Loading branch information
themsaid authored and taylorotwell committed Jul 19, 2016
1 parent 061614c commit 83d3ce2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Illuminate/Validation/Validator.php
Original file line number Diff line number Diff line change
Expand Up @@ -1508,7 +1508,7 @@ protected function validateUrl($attribute, $value)
(/?|/\S+|\?\S*|\#\S*) # a /, nothing, a / with something, a query or a fragment
$~ixu';

return preg_match($pattern, $value) === 1;
return preg_match($pattern, $value) > 0;
}

/**
Expand Down Expand Up @@ -1669,7 +1669,7 @@ protected function validateAlphaNum($attribute, $value)
return false;
}

return preg_match('/^[\pL\pM\pN]+$/u', $value);
return preg_match('/^[\pL\pM\pN]+$/u', $value) > 0;
}

/**
Expand All @@ -1685,7 +1685,7 @@ protected function validateAlphaDash($attribute, $value)
return false;
}

return preg_match('/^[\pL\pM\pN_-]+$/u', $value);
return preg_match('/^[\pL\pM\pN_-]+$/u', $value) > 0;
}

/**
Expand All @@ -1704,7 +1704,7 @@ protected function validateRegex($attribute, $value, $parameters)

$this->requireParameterCount(1, $parameters, 'regex');

return preg_match($parameters[0], $value);
return preg_match($parameters[0], $value) > 0;
}

/**
Expand Down

0 comments on commit 83d3ce2

Please sign in to comment.