[wp-trac] [WordPress Trac] #8493: wp-login.php redirect to profile.php broken

WordPress Trac wp-trac at lists.automattic.com
Thu Dec 4 23:16:49 GMT 2008


#8493: wp-login.php redirect to profile.php broken
---------------------+------------------------------------------------------
 Reporter:  drossy   |       Owner:  anonymous
     Type:  defect   |      Status:  new      
 Priority:  normal   |   Milestone:  2.8      
Component:  General  |     Version:           
 Severity:  normal   |    Keywords:           
---------------------+------------------------------------------------------
 wp-login.php has code that should redirect users without the capability to
 edit posts to their profile page upon login rather than the dashboard,
 however it seems to be checking for the wrong value of {{{$redirect_to}}},
 the patch adds in the value that worked for me.

 Derek Ross

 {{{
 *** wp-login.php.old    2008-08-26 18:57:29.000000000 +0100
 --- wp-login.php        2008-12-04 22:46:22.000000000 +0000
 ***************
 *** 429,433 ****
         if ( !is_wp_error($user) ) {
                 // If the user can't edit posts, send them to their
 profile.
 !               if ( !$user->has_cap('edit_posts') && ( empty(
 $redirect_to ) || $redirect_to == 'wp-admin/' ) )
                         $redirect_to = admin_url('profile.php');
                 wp_safe_redirect($redirect_to);
 --- 429,433 ----
         if ( !is_wp_error($user) ) {
                 // If the user can't edit posts, send them to their
 profile.
 !               if ( !$user->has_cap('edit_posts') && ( empty(
 $redirect_to ) || $redirect_to == 'wp-admin/' || $redirect_to ==
 admin_url()) )
                         $redirect_to = admin_url('profile.php');
                 wp_safe_redirect($redirect_to);
 ***************
 }}}

-- 
Ticket URL: <http://trac.wordpress.org/ticket/8493>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list