Changeset 2323 for sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/index.php
- Timestamp:
- 01/19/2016 04:14:28 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/index.php
r2313 r2323 8 8 get_header(); 9 9 10 if ( ! empty( $_GET['screen'] ) ) { 11 $screen = preg_replace( '/[^a-z0-9-]/', '', $_GET['screen'] ); 12 } else if ( preg_match( '/^\/oauth([\/\?]{1}.*)?$/', $_SERVER['REQUEST_URI'] ) ) { 13 $screen = 'oauth'; 10 /** 11 * Test if the path we're on is one that we use, depending on if it 12 * has a partial or not, or load the 404 partial as fallback. 13 * 14 * Note that the path is first validated in WP_WPOrg_SSO::redirect_all_login_or_signup_to_sso(). 15 * @see https://meta.trac.wordpress.org/browser/sites/trunk/common/includes/wporg-sso/wp-plugin.php 16 */ 17 18 if ( apply_filters( 'is_valid_wporg_sso_path', false ) && preg_match( '!^(/[^/\?]*)([/\?]{1,2}.*)?$!', $_SERVER['REQUEST_URI'], $matches ) ) { 19 $screen = '/' === $matches[1] ? 'login' : preg_replace( '/[^a-z0-9-]/', '', $matches[1] ); 14 20 } else { 15 $screen = ' login';21 $screen = '404'; 16 22 } 17 23 18 $partial = __DIR__ . '/partials/' . $screen . '.php'; 24 $partials_dir = __DIR__ . '/partials/'; 25 $partial = $partials_dir . $screen . '.php'; 19 26 20 27 if ( file_exists( $partial ) ) { 21 28 require_once( $partial ); 29 } else { 30 require_once( $partials_dir . '404.php'); 22 31 } 23 32
Note: See TracChangeset
for help on using the changeset viewer.