Skip to content

Commit

Permalink
UPD: Switched from FILTER_VALIDATE_BOOLEAN to FILTER_VALIDATE_BOOL
Browse files Browse the repository at this point in the history
  • Loading branch information
aalexandr21 authored and girafffee committed May 30, 2024
1 parent d4ec776 commit 1661928
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion includes/actions/types/mailchimp.php
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ function ( $tag ) use ( $status ) {
private function get_body_args( $fields_map ) {
$status_if_new = isset( $this->settings['double_opt_in'] ) && filter_var(
$this->settings['double_opt_in'],
FILTER_VALIDATE_BOOLEAN
defined( 'FILTER_VALIDATE_BOOL' ) ? FILTER_VALIDATE_BOOL : FILTER_VALIDATE_BOOLEAN
) ? 'pending' : 'subscribed';

$body_args = array(
Expand Down
2 changes: 1 addition & 1 deletion includes/admin/tabs-handlers/options-handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function on_get_request() {

$options[ $name ] = filter_var(
sanitize_key( $_POST[ $name ] ),
FILTER_VALIDATE_BOOLEAN
defined( 'FILTER_VALIDATE_BOOL' ) ? FILTER_VALIDATE_BOOL : FILTER_VALIDATE_BOOLEAN
);

}
Expand Down
2 changes: 1 addition & 1 deletion modules/gateways/base-gateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ public function set_current_gateway_options() {

foreach ( $this->options_list() as $name => $option ) {
$is_required = (
! isset( $option['required'] ) || filter_var( $option['required'], FILTER_VALIDATE_BOOLEAN )
! isset( $option['required'] ) || filter_var( $option['required'], defined( 'FILTER_VALIDATE_BOOL' ) ? FILTER_VALIDATE_BOOL : FILTER_VALIDATE_BOOLEAN )
);

$default_val = $option['default'] ?? false;
Expand Down
2 changes: 1 addition & 1 deletion modules/option-query/meta-query.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public function fetch(): \Generator {
*/
protected function get_checked_options( $options ): \Generator {
foreach ( $options as $label => $checked ) {
$checked = filter_var( $checked, FILTER_VALIDATE_BOOLEAN );
$checked = filter_var( $checked, defined( 'FILTER_VALIDATE_BOOL' ) ? FILTER_VALIDATE_BOOL : FILTER_VALIDATE_BOOLEAN );

if ( $this->has_query( 'search' ) &&
false === strpos( (string) $label, $this->get_query( 'search' ) )
Expand Down
2 changes: 1 addition & 1 deletion templates/fields/calculated-field.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
$prefix = ! empty( $args['calc_prefix'] ) ? $args['calc_prefix'] : false;
$suffix = ! empty( $args['calc_suffix'] ) ? $args['calc_suffix'] : false;
$precision = isset( $args['precision'] ) ? $args['precision'] : 0;
$is_hidden = isset( $args['calc_hidden'] ) ? filter_var( $args['calc_hidden'], FILTER_VALIDATE_BOOLEAN ) : false;
$is_hidden = isset( $args['calc_hidden'] ) ? filter_var( $args['calc_hidden'], defined( 'FILTER_VALIDATE_BOOL' ) ? FILTER_VALIDATE_BOOL : FILTER_VALIDATE_BOOLEAN ) : false;

$this->add_attribute( 'class', $args['class_name'] );
$this->add_attribute( 'data-formula', $formula );
Expand Down
2 changes: 1 addition & 1 deletion vendor/composer/ClassLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ public function isClassMapAuthoritative()
*/
public function setApcuPrefix($apcuPrefix)
{
$this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null;
$this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), defined( 'FILTER_VALIDATE_BOOL' ) ? FILTER_VALIDATE_BOOL : FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null;
}

/**
Expand Down

0 comments on commit 1661928

Please sign in to comment.