From 3361f90a1c81043ea65473f325d28ab40cf632d1 Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Sat, 5 Sep 2015 21:34:24 +0000 Subject: [PATCH] When a user with no role logs in, redirect them to the home page rather than their profile screen which they do not have access to. See #25162 Built from https://develop.svn.wordpress.org/trunk@33924 git-svn-id: http://core.svn.wordpress.org/trunk@33893 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/version.php | 2 +- wp-login.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-includes/version.php b/wp-includes/version.php index d6d7f2b9a5..808ae63b46 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.4-alpha-33923'; +$wp_version = '4.4-alpha-33924'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. diff --git a/wp-login.php b/wp-login.php index 42a7cece63..9963a22e6a 100644 --- a/wp-login.php +++ b/wp-login.php @@ -851,7 +851,7 @@ default: elseif ( is_multisite() && !$user->has_cap('read') ) $redirect_to = get_dashboard_url( $user->ID ); elseif ( !$user->has_cap('edit_posts') ) - $redirect_to = admin_url('profile.php'); + $redirect_to = $user->has_cap( 'read' ) ? admin_url( 'profile.php' ) : home_url(); } wp_safe_redirect($redirect_to); exit();