diff -r 490d5cc509ed -r cf61fcea0001 wp/wp-login.php
--- a/wp/wp-login.php Tue Jun 09 11:14:17 2015 +0000
+++ b/wp/wp-login.php Mon Oct 14 17:39:30 2019 +0200
@@ -14,10 +14,10 @@
// Redirect to https login if forced to use SSL
if ( force_ssl_admin() && ! is_ssl() ) {
if ( 0 === strpos($_SERVER['REQUEST_URI'], 'http') ) {
- wp_redirect( set_url_scheme( $_SERVER['REQUEST_URI'], 'https' ) );
+ wp_safe_redirect( set_url_scheme( $_SERVER['REQUEST_URI'], 'https' ) );
exit();
} else {
- wp_redirect( 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );
+ wp_safe_redirect( 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );
exit();
}
}
@@ -28,24 +28,24 @@
* @param string $title Optional. WordPress login Page title to display in the `
` element.
* Default 'Log In'.
* @param string $message Optional. Message to display in header. Default empty.
- * @param WP_Error $wp_error Optional. The error to pass. Default empty.
+ * @param WP_Error $wp_error Optional. The error to pass. Default is a WP_Error instance.
*/
-function login_header( $title = 'Log In', $message = '', $wp_error = '' ) {
+function login_header( $title = 'Log In', $message = '', $wp_error = null ) {
global $error, $interim_login, $action;
// Don't index any of these forms
add_action( 'login_head', 'wp_no_robots' );
- if ( wp_is_mobile() )
- add_action( 'login_head', 'wp_login_viewport_meta' );
+ add_action( 'login_head', 'wp_login_viewport_meta' );
- if ( empty($wp_error) )
+ if ( ! is_wp_error( $wp_error ) ) {
$wp_error = new WP_Error();
+ }
// Shake it!
$shake_error_codes = array( 'empty_password', 'empty_email', 'invalid_email', 'invalidcombo', 'empty_username', 'invalid_username', 'incorrect_password' );
/**
- * Filter the error codes array for shaking the login form.
+ * Filters the error codes array for shaking the login form.
*
* @since 3.0.0
*
@@ -56,6 +56,21 @@
if ( $shake_error_codes && $wp_error->get_error_code() && in_array( $wp_error->get_error_code(), $shake_error_codes ) )
add_action( 'login_head', 'wp_shake_js', 12 );
+ $login_title = get_bloginfo( 'name', 'display' );
+
+ /* translators: Login screen title. 1: Login screen name, 2: Network or site name */
+ $login_title = sprintf( __( '%1$s ‹ %2$s — WordPress' ), $title, $login_title );
+
+ /**
+ * Filters the title tag content for login page.
+ *
+ * @since 4.9.0
+ *
+ * @param string $login_title The page title, with extra context added.
+ * @param string $title The original page title.
+ */
+ $login_title = apply_filters( 'login_title', $login_title, $title );
+
?>
- ›
+
site_name;
+ $login_header_title = get_network()->site_name;
} else {
$login_header_url = __( 'https://wordpress.org/' );
$login_header_title = __( 'Powered by WordPress' );
}
/**
- * Filter link URL of the header logo above login form.
+ * Filters link URL of the header logo above login form.
*
* @since 2.1.0
*
* @param string $login_header_url Login header logo URL.
*/
$login_header_url = apply_filters( 'login_headerurl', $login_header_url );
+
/**
- * Filter the title attribute of the header logo above login form.
+ * Filters the title attribute of the header logo above login form.
*
* @since 2.1.0
*
@@ -119,9 +136,17 @@
*/
$login_header_title = apply_filters( 'login_headertitle', $login_header_title );
+ /*
+ * To match the URL/title set above, Multisite sites have the blog name,
+ * while single sites get the header title.
+ */
+ if ( is_multisite() ) {
+ $login_header_text = get_bloginfo( 'name', 'display' );
+ } else {
+ $login_header_text = $login_header_title;
+ }
+
$classes = array( 'login-action-' . $action, 'wp-core-ui' );
- if ( wp_is_mobile() )
- $classes[] = 'mobile';
if ( is_rtl() )
$classes[] = 'rtl';
if ( $interim_login ) {
@@ -136,7 +161,7 @@
$classes[] =' locale-' . sanitize_html_class( strtolower( str_replace( '_', '-', get_locale() ) ) );
/**
- * Filter the login page body classes.
+ * Filters the login page body classes.
*
* @since 3.5.0
*
@@ -148,14 +173,22 @@
?>
+
' ); ?>
@@ -241,9 +278,10 @@