Skip to content

Commit

Permalink
Fix Uncaught TypeError
Browse files Browse the repository at this point in the history
Fixes #153.
  • Loading branch information
chesio committed Feb 7, 2024
1 parent 73cb3eb commit 2255488
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
6 changes: 4 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# BC Security Changelog

## Upcoming version 0.22.1 (????-??-??)
## Version 0.22.1 (2024-02-07)

...
### Fixed

* Fix `Uncaught TypeError` when saving external blocklist settings [#153](https://github.com/chesio/bc-security/issues/153).

## Version 0.22.0 (2024-02-01)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,16 @@ class Settings extends CoreSettings
/**
* Sanitize lock scope values. Allow only expected values.
*
* @param int $value
* @internal Form data are submitted as string, so always accept string type for $value.
*
* @param int|string $value
* @param int $default
*
* @return int
*/
public static function sanitizeAccessScope(int $value, int $default): int
public static function sanitizeAccessScope(int|string $value, int $default): int
{
return Scope::tryFrom($value) ? $value : $default;
return Scope::tryFrom((int) $value) ? ((int) $value) : $default;
}

/**
Expand Down

0 comments on commit 2255488

Please sign in to comment.