diff --git a/wp-includes/class-wp-query.php b/wp-includes/class-wp-query.php index 8afad87ec3..bdfce5e52c 100644 --- a/wp-includes/class-wp-query.php +++ b/wp-includes/class-wp-query.php @@ -1461,7 +1461,7 @@ class WP_Query { foreach ( $q['search_terms'] as $term ) { // If there is an $exclusion_prefix, terms prefixed with it should be excluded. - $exclude = $exclusion_prefix && ( substr( $term, 0, 1 ) === $exclusion_prefix ); + $exclude = $exclusion_prefix && str_starts_with( $term, $exclusion_prefix ); if ( $exclude ) { $like_op = 'NOT LIKE'; $andor_op = 'AND'; diff --git a/wp-includes/deprecated.php b/wp-includes/deprecated.php index cac1126dbe..750260ab56 100644 --- a/wp-includes/deprecated.php +++ b/wp-includes/deprecated.php @@ -947,7 +947,7 @@ function get_links($category = -1, $before = '', $after = '
', $between = ' _deprecated_function( __FUNCTION__, '2.1.0', 'get_bookmarks()' ); $order = 'ASC'; - if ( substr($orderby, 0, 1) === '_' ) { + if ( str_starts_with($orderby, '_') ) { $order = 'DESC'; $orderby = substr($orderby, 1); } diff --git a/wp-includes/link-template.php b/wp-includes/link-template.php index 16c9da2d3b..2fe4483a7a 100644 --- a/wp-includes/link-template.php +++ b/wp-includes/link-template.php @@ -3891,7 +3891,7 @@ function set_url_scheme( $url, $scheme = null ) { } $url = trim( $url ); - if ( substr( $url, 0, 2 ) === '//' ) { + if ( str_starts_with( $url, '//' ) ) { $url = 'http:' . $url; } diff --git a/wp-includes/ms-functions.php b/wp-includes/ms-functions.php index bf62d0c127..3a4dd3115d 100644 --- a/wp-includes/ms-functions.php +++ b/wp-includes/ms-functions.php @@ -401,13 +401,12 @@ function is_email_address_unsafe( $user_email ) { continue; } - if ( $email_domain == $banned_domain ) { + if ( $email_domain === $banned_domain ) { $is_email_address_unsafe = true; break; } - $dotted_domain = ".$banned_domain"; - if ( substr( $normalized_email, -strlen( $dotted_domain ) ) === $dotted_domain ) { + if ( str_ends_with( $normalized_email, ".$banned_domain" ) ) { $is_email_address_unsafe = true; break; } diff --git a/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php b/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php index 98c0a1bb64..d1f91b1e20 100644 --- a/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php +++ b/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php @@ -1137,7 +1137,7 @@ class WP_REST_Attachments_Controller extends WP_REST_Posts_Controller { $filename = trim( $attributes['filename'] ); // Unquote quoted filename, but after trimming. - if ( substr( $filename, 0, 1 ) === '"' && substr( $filename, -1, 1 ) === '"' ) { + if ( str_starts_with( $filename, '"' ) && str_ends_with( $filename, '"' ) ) { $filename = substr( $filename, 1, -1 ); } } diff --git a/wp-includes/version.php b/wp-includes/version.php index b11ed29d98..04ceb76707 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.3-alpha-56018'; +$wp_version = '6.3-alpha-56019'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.