Changeset 9461
- Timestamp:
- 02/04/2020 12:16:34 AM (5 years ago)
- Location:
- sites/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/common/includes/wporg-sso/wp-plugin.php
r9459 r9461 33 33 34 34 /** 35 * Holds the route regex hit in `valid_sso_paths` 36 * @var bool|string 37 */ 38 static $matched_route_regex = false; 39 40 /** 35 41 * Holds any matched route params. 36 42 * @var array … … 211 217 if ( ! preg_match( '!/wp-login\.php$!', $this->script ) ) { 212 218 // ... but not on its login screen. 213 self::$matched_route = false; 219 self::$matched_route = false; 220 self::$matched_route_regex = false; 214 221 self::$matched_route_params = array(); 215 222 foreach ( $this->valid_sso_paths as $route => $regex ) { 216 223 if ( preg_match( '!^' . $regex . '(?:[/?]{1,2}.*)?$!', $_SERVER['REQUEST_URI'], $matches ) ) { 217 self::$matched_route = $route; 224 self::$matched_route = $route; 225 self::$matched_route_regex = $regex; 218 226 self::$matched_route_params = $matches; 219 227 break; -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/functions.php
r9253 r9461 355 355 } 356 356 add_action( 'login_purge_pending_registrations', 'wporg_login_purge_pending_registrations' ); 357 358 /** 359 * Add a canonical tag to the login screens. 360 */ 361 function wporg_login_canonical_link() { 362 $canonical = false; 363 364 // If the regular expression for this route is not matching, it's the canonical. 365 if ( false === stripos( WP_WPOrg_SSO::$matched_route_regex, '(' ) ) { 366 $canonical = site_url( WP_WPOrg_SSO::$matched_route_regex ); 367 } 368 369 if ( $canonical ) { 370 printf( '<link rel="canonical" href="%s" />', esc_url( $canonical ) ); 371 } 372 } 373 add_action( 'login_head', 'wporg_login_canonical_link' ); 374 add_action( 'wp_head', 'wporg_login_canonical_link' );
Note: See TracChangeset
for help on using the changeset viewer.