Making WordPress.org

Changeset 10979


Ignore:
Timestamp:
05/14/2021 04:52:26 AM (3 years ago)
Author:
dd32
Message:

Login: Try normalising the request uri before matching against pages.

This might work around the bug causing an infinite loop on login.wordpress.org.

See r10973

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/common/includes/wporg-sso/wp-plugin.php

    r10977 r10979  
    302302                    self::$matched_route_params = array();
    303303                    foreach ( $this->valid_sso_paths as $route => $regex ) {
    304                         if ( preg_match( '!^' . $regex . '(?:[/?]{1,2}.*)?$!', $_SERVER['REQUEST_URI'], $matches ) ) {
     304                        // Process the URI with trailing `/.`, `/..`, `/. ` and `/.%20` normalised to `/`.
     305                        $request_uri = preg_replace( '!/[ .]+$!', '/', urldecode( $_SERVER['REQUEST_URI'] ) );
     306                        if ( preg_match( '!^' . $regex . '(?:[/?]{1,2}.*)?$!', $request_uri, $matches ) ) {
    305307                            self::$matched_route        = $route;
    306308                            self::$matched_route_regex  = $regex;
Note: See TracChangeset for help on using the changeset viewer.