psss
may leave in place (do not deactivate commenting it with //) just the line
wp_redirect( $redirect_to ); exit();
and may change it into:
wp_safe_redirect( $redirect_to ); exit();
maybe do not comment out it, so that when an explicit redirect require to happen it will go as it need to be.
If no more improvements added, because not useful, the 2.6.6 coming code will be like this, into last part of the verify_credentials function:
$redirect_to = isset( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : '';
if ( ( empty( $redirect_to ) || $redirect_to == admin_url() ) )
{
// If the user doesn't belong to a blog, send them to user admin. If the user can't edit posts, send them to their profile.
if ( is_multisite() && !get_active_blog_for_user($user->ID) && !is_super_admin( $user->ID ) )
$redirect_to = user_admin_url();
elseif ( is_multisite() )
$redirect_to = get_dashboard_url( $user->ID );
elseif ( is_admin() )
$redirect_to = admin_url( 'profile.php' );
// (try) check if it is a login done via phpBB into WP iframed page AND AVOID redirect to iframe if it is the first time login, so subsequent addition of the user in WP
// or duplicate WP insertion in wp will happen!!
// if it is a first time login, AVOID the redirect to page-forum (if in iframe mode and user regitered then login in phpBB iframed)
if( !isset($on_ins) && isset($_SERVER['REQUEST_URI']) && !empty($wp_w3all_forum_folder_wp) && strstr($_SERVER['REQUEST_URI'], $wp_w3all_forum_folder_wp) )
{
$redirect_to = home_url() . '/' . $wp_w3all_forum_folder_wp; // this will cause duplicated user insert in wp, if phpBB login first time done in phpBB iframed
wp_redirect( $redirect_to ); exit();
}
if( !empty($redirect_to) ){
wp_redirect($redirect_to); exit();
}
}
wp_safe_redirect($redirect_to); exit();
}
return;