chesio / bc-security

Helps keeping WordPress websites secure.
The Unlicense
14 stars 3 forks source link

Uncaught TypeError #153

Closed chesio closed 5 months ago

chesio commented 5 months ago

When saving external blocklist settings:

PHP Fatal error:  Uncaught TypeError: BlueChip\Security\Modules\ExternalBlocklist\Settings::sanitizeAccessScope(): Argument #1 ($value) must be of type int, string given, called in /[...]/bc-security/classes/BlueChip/Security/Core/Settings.php on line 239 and defined in /[...]/bc-security/classes/BlueChip/Security/Modules/ExternalBlocklist/Settings.php:35

Seems to be regression introduced in https://github.com/chesio/bc-security/commit/44f97321530c5b7af6c74dfe58ae6b3506f8665e.

szepeviktor commented 5 months ago

How has static analysis missed it?

chesio commented 4 months ago

How has static analysis missed it?

Well, I don't know how well static analysis can deal with WordPress Settings API and the way sanitization callbacks are executed there... But I got the inputs sanitization wrong on my side (or at least not good enough). I hopefully fixed it now in 0c7b11d.