Commit 581ca359b1 for wordpress.org

commit 581ca359b16e8b946c46b592cc2997b4b038011e
Author: jorgefilipecosta <jorgefilipecosta@git.wordpress.org>
Date:   Fri Oct 16 22:42:49 2026 +0000

    Connectors: Match the settings route the way the REST server does.

    `_wp_connectors_rest_settings_dispatch()` now matches the request route with the REST server's own pattern, to fix possible inconsistencies with the server's route matching.

    Follow-up to [61749], [62684].

    Props mcliwanow, jorgefilipecosta.
    Fixes #66330.
    Built from https://develop.svn.wordpress.org/trunk@64432


    git-svn-id: http://core.svn.wordpress.org/trunk@63582 1a063a9b-81f0-0310-95a4-ce76da25c4cd

diff --git a/wp-includes/connectors.php b/wp-includes/connectors.php
index 9c83a973eb..88f6a5b964 100644
--- a/wp-includes/connectors.php
+++ b/wp-includes/connectors.php
@@ -696,7 +696,8 @@ function wp_connectors_sanitize_application_password_credentials( $value, string
  * @return WP_REST_Response The modified response with masked/validated keys.
  */
 function _wp_connectors_rest_settings_dispatch( WP_REST_Response $response, WP_REST_Server $server, WP_REST_Request $request ): WP_REST_Response {
-	if ( '/wp/v2/settings' !== $request->get_route() ) {
+	// Match the route the way WP_REST_Server::match_request_to_handler() does, ignoring case.
+	if ( ! preg_match( '@^/wp/v2/settings$@i', $request->get_route() ) ) {
 		return $response;
 	}

diff --git a/wp-includes/version.php b/wp-includes/version.php
index 3c3c129714..160306ba95 100644
--- a/wp-includes/version.php
+++ b/wp-includes/version.php
@@ -16,7 +16,7 @@
  *
  * @global string $wp_version
  */
-$wp_version = '7.2-alpha-64431';
+$wp_version = '7.2-alpha-64432';

 /**
  * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.