Changeset 4470 for sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/index.php
- Timestamp:
- 12/04/2016 05:54:55 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/index.php
r4119 r4470 6 6 */ 7 7 8 get_header(); 8 // Silence is Golden. If we're at this point, then no template exists for the given request yet. 9 wp_safe_redirect( '/' ); 9 10 10 /**11 * Test if the path we're on is one that we use, depending on if it12 * 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.php16 */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] );20 } else {21 $screen = '404';22 }23 24 $partials_dir = __DIR__ . '/partials/';25 $partial = $partials_dir . $screen . '.php';26 27 if ( file_exists( $partial ) ) {28 if ( ! headers_sent() ) {29 status_header( 200 );30 }31 require_once( $partial );32 } else {33 if ( ! headers_sent() ) {34 status_header( 404 );35 }36 require_once( $partials_dir . '404.php');37 }38 39 get_footer();
Note: See TracChangeset
for help on using the changeset viewer.