Code Duplication    Length = 9-9 lines in 2 locations

wp-includes/pluggable.php 2 locations

@@ 971-979 (lines=9) @@
968
	$secure = apply_filters( 'secure_auth_redirect', $secure );
969
970
	// If https is required and request is http, redirect
971
	if ( $secure && !is_ssl() && false !== strpos($_SERVER['REQUEST_URI'], 'wp-admin') ) {
972
		if ( 0 === strpos( $_SERVER['REQUEST_URI'], 'http' ) ) {
973
			wp_redirect( set_url_scheme( $_SERVER['REQUEST_URI'], 'https' ) );
974
			exit();
975
		} else {
976
			wp_redirect( 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );
977
			exit();
978
		}
979
	}
980
981
	/**
982
	 * Filters the authentication redirect scheme.
@@ 1001-1009 (lines=9) @@
998
		do_action( 'auth_redirect', $user_id );
999
1000
		// If the user wants ssl but the session is not ssl, redirect.
1001
		if ( !$secure && get_user_option('use_ssl', $user_id) && false !== strpos($_SERVER['REQUEST_URI'], 'wp-admin') ) {
1002
			if ( 0 === strpos( $_SERVER['REQUEST_URI'], 'http' ) ) {
1003
				wp_redirect( set_url_scheme( $_SERVER['REQUEST_URI'], 'https' ) );
1004
				exit();
1005
			} else {
1006
				wp_redirect( 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );
1007
				exit();
1008
			}
1009
		}
1010
1011
		return;  // The cookie is good so we're done
1012
	}