WordPress.org

Making WordPress.org

Changeset 9182


Ignore:
Timestamp:
10/15/2019 07:23:53 AM (6 months ago)
Author:
dd32
Message:

SSO: Swap a bunch of login/registration redirects to 301's.

See #4630.

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

Legend:

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

    r3166 r9182  
    3535                // Redirect registration request to the one we want to standardize on.
    3636                if ( "https://{$this->host}{$this->script}" !== $this->sso_signup_url ) {
    37                     $this->_safe_redirect( $this->sso_signup_url );
     37                    $this->_safe_redirect( $this->sso_signup_url, 301 );
    3838                }
    3939            } else if ( preg_match( '/\/bb-login\.php$/', $this->script ) ) {
     
    5757
    5858                // Redirect to SSO login, trying to pass on a decent redirect_to request.
    59                 $this->_safe_redirect( $redirect_to_sso_login );
     59                $this->_safe_redirect( $redirect_to_sso_login, 301 );
    6060            }
    6161        }
  • sites/trunk/common/includes/wporg-sso/wp-plugin.php

    r9146 r9182  
    169169            if ( preg_match( '!/wp-signup\.php$!', $this->script ) ) {
    170170                // If we're on any WP signup screen, redirect to the SSO host one,respecting the user's redirect_to request
    171                 $this->_safe_redirect( add_query_arg( 'redirect_to', urlencode( $redirect_req ), $this->sso_signup_url ) );
     171                $this->_safe_redirect( add_query_arg( 'redirect_to', urlencode( $redirect_req ), $this->sso_signup_url ), 301 );
    172172
    173173            } elseif ( ! $this->is_sso_host() ) {
     
    191191
    192192                    // And actually redirect to the SSO login
    193                     $this->_safe_redirect( $redirect_to_sso_login );
     193                    $this->_safe_redirect( $redirect_to_sso_login, 301 );
    194194
    195195                } else {
     
    226226                                    $get['redirect_to'] = $this->_get_safer_redirect_to();
    227227                                }
    228                                 $this->_safe_redirect( add_query_arg( $get, $this->sso_login_url . '/wp-login.php' ) );
     228                                $this->_safe_redirect( add_query_arg( $get, $this->sso_login_url . '/wp-login.php' ), 301 );
    229229                                return;
    230230                            } else {
     
    253253                    } else {
    254254                        // Otherwise, redirect to the login screen.
    255                         $this->_safe_redirect( $this->sso_login_url );
     255                        $this->_safe_redirect( $this->sso_login_url, 301 );
    256256                    }
    257257                } else {
     
    360360                $this->_safe_redirect( $this->_get_safer_redirect_to() );
    361361            } else {
    362                 $this->_safe_redirect( 'https://profiles.wordpress.org/' . wp_get_current_user()->user_nicename );
     362                $this->_safe_redirect( 'https://profiles.wordpress.org/' . wp_get_current_user()->user_nicename . '/' );
    363363            }
    364364        }
Note: See TracChangeset for help on using the changeset viewer.