WordPress.org

Making WordPress.org

Changeset 7695


Ignore:
Timestamp:
09/24/2018 03:45:23 AM (13 months ago)
Author:
dd32
Message:

Login: Allow query parameters on the /logout route. This is needed to support the locale switcher, and future custom redirection locations.

See #3821.
Fixes #3823.

Location:
sites/trunk/common/includes/wporg-sso
Files:
2 edited

Legend:

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

    r7689 r7695  
    4444                // If on the SSO host, add the requesting source (eg: make.wordpress.org), if within our bounds
    4545                $url  = parse_url( $this->_get_safer_redirect_to() );
    46                 $host = ( empty( $url ) ) ? null : $url['host'];
     46                $host = ( ! $url || ! isset( $url['host'] ) ) ? null : $url['host'];
    4747            } else {
    4848                // If not on the SSO host, add login.wordpress.org, to be safe
  • sites/trunk/common/includes/wporg-sso/wp-plugin.php

    r7648 r7695  
    232232                                return;
    233233                            }
     234                        } else if ( is_user_logged_in() && 'logout' == self::$matched_route ) {
     235                            // No redirect, ask the user if they really want to log out.
     236                            return;
    234237                        } else if ( is_user_logged_in() ) {
    235                             if ( preg_match( '!^' . $this->valid_sso_paths['logout'] . '/?$!', $_SERVER['REQUEST_URI'] ) ) {
    236                                 // No redirect, ask the user if they really want to log out.
    237                                 return;
    238                             } else {
    239                                 // Otherwise, redirect to the login screen.
    240                                 $this->_redirect_to_profile();
    241                             }
     238                            // Otherwise, redirect to the their profile.
     239                            $this->_redirect_to_profile();
    242240                        }
    243241                    } elseif ( ( is_admin() && is_super_admin() ) || 0 === strpos( $_SERVER['REQUEST_URI'], '/wp-json' ) || 0 === strpos( $_SERVER['REQUEST_URI'], '/xmlrpc.php' ) ) {
Note: See TracChangeset for help on using the changeset viewer.