Changeset 6676
- Timestamp:
- 02/17/2018 12:14:14 PM (7 years ago)
- Location:
- sites/trunk/common/includes/wporg-sso
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/common/includes/wporg-sso/class-wporg-sso.php
r4964 r6676 41 41 */ 42 42 public function add_allowed_redirect_host( $hosts ) { 43 if ( self::SSO_HOST === $this->host) {43 if ( $this->is_sso_host() ) { 44 44 // If on the SSO host, add the requesting source (eg: make.wordpress.org), if within our bounds 45 45 $url = parse_url( $this->_get_safer_redirect_to() ); … … 89 89 public function has_host() { 90 90 return ( ! empty( $this->host ) ); 91 } 92 93 /** 94 * Whether the current host is the SSO host. 95 * 96 * @return bool True if current host is the SSO host, false if not. 97 */ 98 public function is_sso_host() { 99 return self::SSO_HOST === $this->host; 91 100 } 92 101 -
sites/trunk/common/includes/wporg-sso/wp-plugin.php
r6661 r6676 55 55 add_filter( 'pre_site_option_registration', array( $this, 'inherit_registration_option' ) ); 56 56 57 add_filter( 'login_url', [$this, 'add_locale'], 21 ); 58 add_filter( 'register_url', [$this, 'add_locale'], 21 ); 59 add_filter( 'lostpassword_url', [$this, 'add_locale'], 21 ); 57 if ( ! $this->is_sso_host() ) { 58 add_filter( 'login_url', [ $this, 'add_locale' ], 21 ); 59 add_filter( 'register_url', [ $this, 'add_locale' ], 21 ); 60 add_filter( 'lostpassword_url', [ $this, 'add_locale' ], 21 ); 61 } 60 62 } 61 63 } … … 162 164 $this->_safe_redirect( add_query_arg( 'redirect_to', urlencode( $redirect_req ), $this->sso_signup_url ) ); 163 165 164 } elseif ( self::SSO_HOST !== $this->host) {166 } elseif ( ! $this->is_sso_host() ) { 165 167 // If we're not on the SSO host 166 168 if ( preg_match( '!/wp-login\.php$!', $this->script ) ) {
Note: See TracChangeset
for help on using the changeset viewer.