Skip to content

Commit

Permalink
Fixed boolean validating string as bool
Browse files Browse the repository at this point in the history
  • Loading branch information
jamielsharief committed Jul 30, 2020
1 parent 02c5dc2 commit f7ab094
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [unreleased]

### Fixed

- Fixed boolean validating string as bool

## [1.2.0] - 2020-07-30

## Added
Expand Down
2 changes: 1 addition & 1 deletion src/Validation.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public static function before($value, string $beforeDate = 'now'): bool
*/
public static function boolean($value, array $values = [true, false, 0, 1, '0', '1']): bool
{
return ($value !== null && in_array($value, $values));
return ($value !== null && in_array($value, $values, true));
}

/**
Expand Down

0 comments on commit f7ab094

Please sign in to comment.