Skip to content

Commit

Permalink
fixed the condition for checking value of selector
Browse files Browse the repository at this point in the history
fixed the condition for checking option values ​​for boolean values ​​that are written in selector options as strings
  • Loading branch information
Fellan-91 committed May 24, 2024
1 parent bf8f33c commit 7e4fdbf
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions classes/class-security.php
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,22 @@ public static function sanitize_selector( $attribute, $control ) {
* Exclude multiple and dynamically callback selectors.
*/
if (
empty( $control['value_callback'] ) &&
! isset( $control['options'][ $attribute ] )
(
empty( $control['value_callback'] ) &&
! isset( $control['options'][ $attribute ] ) &&
! is_bool( $attribute )
) ||
is_bool( $attribute ) &&
(
(
true === $attribute &&
! isset( $control['options']['true'] )
) ||
(
false === $attribute &&
! isset( $control['options']['false'] )
)
)
) {
$attribute = self::reset_control_attribute_to_default( $attribute, $control );
}
Expand Down

0 comments on commit 7e4fdbf

Please sign in to comment.