From 30a1eec22acf8ee3a039b5364cd4a71a49d5629c Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sat, 16 Sep 2023 06:50:23 +0000 Subject: [PATCH] Coding Standards: Remove extra parentheses in a few `str_contains()` conditionals. Follow-up to [55988]. Props Cybr. See #58831. Built from https://develop.svn.wordpress.org/trunk@56596 git-svn-id: http://core.svn.wordpress.org/trunk@56108 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/formatting.php | 2 +- wp-includes/vars.php | 4 +++- wp-includes/version.php | 2 +- wp-mail.php | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/wp-includes/formatting.php b/wp-includes/formatting.php index 73d95df2af..8d6d4341c1 100644 --- a/wp-includes/formatting.php +++ b/wp-includes/formatting.php @@ -4522,7 +4522,7 @@ function esc_url( $url, $protocols = null, $_context = 'display' ) { $url = str_replace( "'", ''', $url ); } - if ( ( str_contains( $url, '[' ) ) || ( str_contains( $url, ']' ) ) ) { + if ( str_contains( $url, '[' ) || str_contains( $url, ']' ) ) { $parsed = wp_parse_url( $url ); $front = ''; diff --git a/wp-includes/vars.php b/wp-includes/vars.php index 117f053278..d6160dd23e 100644 --- a/wp-includes/vars.php +++ b/wp-includes/vars.php @@ -91,7 +91,9 @@ if ( isset( $_SERVER['HTTP_USER_AGENT'] ) ) { } } elseif ( stripos( $_SERVER['HTTP_USER_AGENT'], 'safari' ) !== false ) { $is_safari = true; - } elseif ( ( str_contains( $_SERVER['HTTP_USER_AGENT'], 'MSIE' ) || str_contains( $_SERVER['HTTP_USER_AGENT'], 'Trident' ) ) && str_contains( $_SERVER['HTTP_USER_AGENT'], 'Win' ) ) { + } elseif ( ( str_contains( $_SERVER['HTTP_USER_AGENT'], 'MSIE' ) || str_contains( $_SERVER['HTTP_USER_AGENT'], 'Trident' ) ) + && str_contains( $_SERVER['HTTP_USER_AGENT'], 'Win' ) + ) { $is_winIE = true; } elseif ( str_contains( $_SERVER['HTTP_USER_AGENT'], 'MSIE' ) && str_contains( $_SERVER['HTTP_USER_AGENT'], 'Mac' ) ) { $is_macIE = true; diff --git a/wp-includes/version.php b/wp-includes/version.php index 6d835817cb..239e141634 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.4-alpha-56595'; +$wp_version = '6.4-alpha-56596'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. diff --git a/wp-mail.php b/wp-mail.php index 1dd1e570d1..c405f6969e 100644 --- a/wp-mail.php +++ b/wp-mail.php @@ -107,7 +107,7 @@ for ( $i = 1; $i <= $count; $i++ ) { $content_transfer_encoding = explode( ';', $content_transfer_encoding ); $content_transfer_encoding = $content_transfer_encoding[0]; } - if ( ( 'multipart/alternative' === $content_type ) && ( str_contains( $line, 'boundary="' ) ) && ( '' === $boundary ) ) { + if ( 'multipart/alternative' === $content_type && str_contains( $line, 'boundary="' ) && '' === $boundary ) { $boundary = trim( $line ); $boundary = explode( '"', $boundary ); $boundary = $boundary[1];