diff --git a/php/class-admin.php b/php/class-admin.php index 2b602787e..4481d5db9 100644 --- a/php/class-admin.php +++ b/php/class-admin.php @@ -153,7 +153,7 @@ public function rest_save_settings( WP_REST_Request $request ) { $data = array_filter( $data, function ( $key ) use ( $settings ) { - return $settings->get_setting( $key, false ); + return (bool) $settings->get_setting( $key, false ); }, ARRAY_FILTER_USE_KEY ); @@ -210,7 +210,7 @@ public function register_admin( $page ) { $page['slug'], '', $page['icon'], - '81.5' + 81.5 ); $connected = $this->settings->get_param( 'connected' ); // Setup the Child page handles. diff --git a/php/class-connect.php b/php/class-connect.php index 3d7345e2e..19e214b77 100644 --- a/php/class-connect.php +++ b/php/class-connect.php @@ -456,7 +456,7 @@ function ( $a ) { $cname_str = $this->extract_cname( $test ); $cname_valid = $this->validate_domain( $cname_str ); - if ( $cname_str && ( ! substr_count( $cname_valid, '.' ) || false === $cname_valid ) ) { + if ( $cname_str && ( false === $cname_valid || ! substr_count( $cname_valid, '.' ) ) ) { $result['type'] = 'invalid_cname'; $result['message'] = __( 'CNAME is not a valid domain name.', 'cloudinary' ); @@ -632,7 +632,7 @@ protected function extract_cname( $parsed_url ) { * * @param string $domain The domain. * - * @return bool + * @return string|false */ protected function validate_domain( $domain ) { $is_valid = false; diff --git a/php/class-deactivation.php b/php/class-deactivation.php index 07a8cd726..e7655abba 100644 --- a/php/class-deactivation.php +++ b/php/class-deactivation.php @@ -185,7 +185,7 @@ public function render_connected() { $is_cloudinary_only = 'cld' === $this->plugin->settings->get_value( 'offload' ); ?> -