Making WordPress.org


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

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

See #4630.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.