diff --git a/wp-admin/plugin-editor.php b/wp-admin/plugin-editor.php index 78eac87f92..1b0b714c32 100644 --- a/wp-admin/plugin-editor.php +++ b/wp-admin/plugin-editor.php @@ -162,7 +162,7 @@ if ( ! empty( $posted_content ) ) { $content = file_get_contents( $real_file ); } -if ( '.php' === substr( $real_file, strrpos( $real_file, '.' ) ) ) { +if ( str_ends_with( $real_file, '.php' ) ) { $functions = wp_doc_link_parse( $content ); if ( ! empty( $functions ) ) { diff --git a/wp-admin/theme-editor.php b/wp-admin/theme-editor.php index 345d00017f..07de6269a7 100644 --- a/wp-admin/theme-editor.php +++ b/wp-admin/theme-editor.php @@ -161,7 +161,7 @@ if ( ! empty( $posted_content ) ) { $f = fopen( $file, 'r' ); $content = fread( $f, filesize( $file ) ); - if ( '.php' === substr( $file, strrpos( $file, '.' ) ) ) { + if ( str_ends_with( $file, '.php' ) ) { $functions = wp_doc_link_parse( $content ); if ( ! empty( $functions ) ) { diff --git a/wp-includes/class-wp-rewrite.php b/wp-includes/class-wp-rewrite.php index 35598c3d80..1963f21b0c 100644 --- a/wp-includes/class-wp-rewrite.php +++ b/wp-includes/class-wp-rewrite.php @@ -1907,7 +1907,7 @@ class WP_Rewrite { unset( $this->feed_structure ); unset( $this->comment_feed_structure ); - $this->use_trailing_slashes = ( '/' === substr( $this->permalink_structure, -1, 1 ) ); + $this->use_trailing_slashes = str_ends_with( $this->permalink_structure, '/' ); // Enable generic rules for pages if permalink structure doesn't begin with a wildcard. if ( preg_match( '/^[^%]*%(?:postname|category|tag|author)%/', $this->permalink_structure ) ) { diff --git a/wp-includes/load.php b/wp-includes/load.php index 6e7ab4cbcd..9d20aff3d7 100644 --- a/wp-includes/load.php +++ b/wp-includes/load.php @@ -877,7 +877,7 @@ function wp_get_active_and_valid_plugins() { foreach ( $active_plugins as $plugin ) { if ( ! validate_file( $plugin ) // $plugin must validate as file. - && '.php' === substr( $plugin, -4 ) // $plugin must end with '.php'. + && str_ends_with( $plugin, '.php' ) // $plugin must end with '.php'. && file_exists( WP_PLUGIN_DIR . '/' . $plugin ) // $plugin must exist. // Not already included as a network plugin. && ( ! $network_plugins || ! in_array( WP_PLUGIN_DIR . '/' . $plugin, $network_plugins, true ) ) diff --git a/wp-includes/rest-api.php b/wp-includes/rest-api.php index d9dd834c90..70dc9deec6 100644 --- a/wp-includes/rest-api.php +++ b/wp-includes/rest-api.php @@ -467,7 +467,7 @@ function get_rest_url( $blog_id = null, $path = '/', $scheme = 'rest' ) { $url = trailingslashit( get_home_url( $blog_id, '', $scheme ) ); // nginx only allows HTTP/1.0 methods when redirecting from / to /index.php. // To work around this, we manually add index.php to the URL, avoiding the redirect. - if ( 'index.php' !== substr( $url, 9 ) ) { + if ( ! str_ends_with( $url, 'index.php' ) ) { $url .= 'index.php'; } diff --git a/wp-includes/version.php b/wp-includes/version.php index e2541215c8..c41589188d 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.3-alpha-56013'; +$wp_version = '6.3-alpha-56014'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.