From 3eec0065e334098b149c3c6c5396799f79801eb3 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Tue, 11 Jul 2023 11:35:23 +0000 Subject: [PATCH] Coding Standards: Use strict comparison in `wp-includes/class-wp-rewrite.php`. Follow-up to [3638], [13689], [19743]. Props aristath, poena, afercia, SergeyBiryukov. See #57839. Built from https://develop.svn.wordpress.org/trunk@56210 git-svn-id: http://core.svn.wordpress.org/trunk@55722 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/class-wp-rewrite.php | 13 ++++++++----- wp-includes/version.php | 2 +- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/wp-includes/class-wp-rewrite.php b/wp-includes/class-wp-rewrite.php index 7580df0e24..1f25b03ada 100644 --- a/wp-includes/class-wp-rewrite.php +++ b/wp-includes/class-wp-rewrite.php @@ -1668,7 +1668,7 @@ class WP_Rewrite { $index = ! str_contains( $query, '?' ) ? strlen( $query ) : strpos( $query, '?' ); $front = substr( $query, 0, $index ); - $external = $front != $this->index; + $external = $front !== $this->index; } // "external" = it doesn't correspond to index.php. @@ -1799,7 +1799,8 @@ class WP_Rewrite { if ( ! is_array( $args ) ) { $args = array( 'with_front' => $args ); } - if ( func_num_args() == 4 ) { + + if ( func_num_args() === 4 ) { $args['ep_mask'] = func_get_arg( 3 ); } @@ -1812,14 +1813,16 @@ class WP_Rewrite { 'walk_dirs' => true, 'endpoints' => true, ); - $args = array_intersect_key( $args, $defaults ); - $args = wp_parse_args( $args, $defaults ); + + $args = array_intersect_key( $args, $defaults ); + $args = wp_parse_args( $args, $defaults ); if ( $args['with_front'] ) { $struct = $this->front . $struct; } else { $struct = $this->root . $struct; } + $args['struct'] = $struct; $this->extra_permastructs[ $name ] = $args; @@ -1937,7 +1940,7 @@ class WP_Rewrite { * @param string $permalink_structure Permalink structure. */ public function set_permalink_structure( $permalink_structure ) { - if ( $permalink_structure != $this->permalink_structure ) { + if ( $this->permalink_structure !== $permalink_structure ) { $old_permalink_structure = $this->permalink_structure; update_option( 'permalink_structure', $permalink_structure ); diff --git a/wp-includes/version.php b/wp-includes/version.php index 3fe41ed651..e7399ffdc1 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.3-beta3-56209'; +$wp_version = '6.3-beta3-56210'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.