X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/72836ec95a52eacbda4dc5aa296b7dd6de08bd3b..4713a14935b83517997f3c88f808eb41da55033d:/wp-login.php diff --git a/wp-login.php b/wp-login.php index 042f29a8..7bb53343 100644 --- a/wp-login.php +++ b/wp-login.php @@ -30,8 +30,8 @@ if ( force_ssl_admin() && ! is_ssl() ) { * @param string $wp_error Optional. The error to pass. Default empty. * @param WP_Error $wp_error Optional. WordPress Error Object */ -function login_header($title = 'Log In', $message = '', $wp_error = '') { - global $error, $interim_login, $current_site, $action; +function login_header( $title = 'Log In', $message = '', $wp_error = '' ) { + global $error, $interim_login, $action; // Don't index any of these forms add_action( 'login_head', 'wp_no_robots' ); @@ -57,14 +57,18 @@ function login_header($title = 'Log In', $message = '', $wp_error = '') { add_action( 'login_head', 'wp_shake_js', 12 ); ?> - > + + + > + <?php bloginfo('name'); ?> › <?php echo $title; ?> site_name; + $login_header_title = get_current_site()->site_name; } else { - $login_header_url = __( 'http://wordpress.org/' ); + $login_header_url = __( 'https://wordpress.org/' ); $login_header_title = __( 'Powered by WordPress' ); } @@ -127,6 +131,7 @@ function login_header($title = 'Log In', $message = '', $wp_error = '') { if ( 'success' === $interim_login ) $classes[] = 'interim-login-success'; } + $classes[] =' locale-' . sanitize_html_class( strtolower( str_replace( '_', '-', get_locale() ) ) ); /** * Filter the login page body classes. @@ -262,7 +267,7 @@ function wp_login_viewport_meta() { * @return bool|WP_Error True: when finish. WP_Error on error */ function retrieve_password() { - global $wpdb, $current_site, $wp_hasher; + global $wpdb, $wp_hasher; $errors = new WP_Error(); @@ -299,8 +304,8 @@ function retrieve_password() { /** * Fires before a new password is retrieved. * - * @since 1.5.2 - * @deprecated 1.5.2 Misspelled. Use 'retrieve_password' hook instead. + * @since 1.5.0 + * @deprecated 1.5.1 Misspelled. Use 'retrieve_password' hook instead. * * @param string $user_login The user login name. */ @@ -308,7 +313,7 @@ function retrieve_password() { /** * Fires before a new password is retrieved. * - * @since 1.5.2 + * @since 1.5.1 * * @param string $user_login The user login name. */ @@ -384,7 +389,7 @@ function retrieve_password() { */ $message = apply_filters( 'retrieve_password_message', $message, $key ); - if ( $message && !wp_mail($user_email, $title, $message) ) + if ( $message && !wp_mail( $user_email, wp_specialchars_decode( $title ), $message ) ) wp_die( __('The e-mail could not be sent.') . "
\n" . __('Possible reason: your host may have disabled the mail() function.') ); return true; @@ -508,7 +513,7 @@ case 'retrievepassword' : /** * Fires before the lost password form. * - * @since 1.5.2 + * @since 1.5.1 */ do_action( 'lost_password' ); @@ -542,7 +547,7 @@ if ( get_option( 'users_can_register' ) ) : /** * Filter the registration URL below the login form. * - * @since 1.5.2 + * @since 1.5.0 * * @param string $registration_url Registration URL. */ @@ -608,9 +613,20 @@ case 'rp' :

-

+


+ +

@@ -740,11 +756,18 @@ default: if ( !$secure_cookie && is_ssl() && force_ssl_login() && !force_ssl_admin() && ( 0 !== strpos($redirect_to, 'https') ) && ( 0 === strpos($redirect_to, 'http') ) ) $secure_cookie = false; - // If cookies are disabled we can't log in even with a valid user+pass - if ( isset($_POST['testcookie']) && empty($_COOKIE[TEST_COOKIE]) ) - $user = new WP_Error('test_cookie', __("ERROR: Cookies are blocked or not supported by your browser. You must enable cookies to use WordPress.")); - else - $user = wp_signon('', $secure_cookie); + $user = wp_signon( '', $secure_cookie ); + + if ( empty( $_COOKIE[ LOGGED_IN_COOKIE ] ) ) { + if ( headers_sent() ) { + $user = new WP_Error( 'test_cookie', sprintf( __( 'ERROR: Cookies are blocked due to unexpected output. For help, please see this documentation or try the support forums.' ), + __( 'http://codex.wordpress.org/Cookies' ), __( 'https://wordpress.org/support/' ) ) ); + } elseif ( isset( $_POST['testcookie'] ) && empty( $_COOKIE[ TEST_COOKIE ] ) ) { + // If cookies are disabled we can't log in even with a valid user+pass + $user = new WP_Error( 'test_cookie', sprintf( __( 'ERROR: Cookies are blocked or not supported by your browser. You must enable cookies to use WordPress.' ), + __( 'http://codex.wordpress.org/Cookies' ) ) ); + } + } $requested_redirect_to = isset( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : ''; /**