From 1661928cca0f2ab91ae20bec0ffef077a9172d75 Mon Sep 17 00:00:00 2001 From: aalexandr21 Date: Thu, 30 May 2024 16:18:12 +0300 Subject: [PATCH] UPD: Switched from `FILTER_VALIDATE_BOOLEAN` to `FILTER_VALIDATE_BOOL` --- includes/actions/types/mailchimp.php | 2 +- includes/admin/tabs-handlers/options-handler.php | 2 +- modules/gateways/base-gateway.php | 2 +- modules/option-query/meta-query.php | 2 +- templates/fields/calculated-field.php | 2 +- vendor/composer/ClassLoader.php | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/includes/actions/types/mailchimp.php b/includes/actions/types/mailchimp.php index 750e4e96..2507f701 100644 --- a/includes/actions/types/mailchimp.php +++ b/includes/actions/types/mailchimp.php @@ -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( diff --git a/includes/admin/tabs-handlers/options-handler.php b/includes/admin/tabs-handlers/options-handler.php index 6b0ef4e7..28faaad0 100644 --- a/includes/admin/tabs-handlers/options-handler.php +++ b/includes/admin/tabs-handlers/options-handler.php @@ -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 ); } diff --git a/modules/gateways/base-gateway.php b/modules/gateways/base-gateway.php index bb10614e..dcde7e16 100644 --- a/modules/gateways/base-gateway.php +++ b/modules/gateways/base-gateway.php @@ -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; diff --git a/modules/option-query/meta-query.php b/modules/option-query/meta-query.php index 3528447a..ddd5a1ee 100644 --- a/modules/option-query/meta-query.php +++ b/modules/option-query/meta-query.php @@ -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' ) ) diff --git a/templates/fields/calculated-field.php b/templates/fields/calculated-field.php index 0a9b63cf..3cfceaa8 100644 --- a/templates/fields/calculated-field.php +++ b/templates/fields/calculated-field.php @@ -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 ); diff --git a/vendor/composer/ClassLoader.php b/vendor/composer/ClassLoader.php index a72151c7..42749b62 100644 --- a/vendor/composer/ClassLoader.php +++ b/vendor/composer/ClassLoader.php @@ -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; } /**