Make WordPress Core

Opened 5 years ago

Last modified 5 years ago

#46033 new defect (bug)

Please fix redirect in wp-login.php

Reported by: tinodjwp's profile tinodjwp Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 5.0.3
Component: Login and Registration Keywords: needs-testing
Focuses: Cc:


On line 619 in wp-login.php there is a redirect that does not take in account site_url setting which is braking experience in some cases. Therefore, the suggested fix is replace

wp_safe_redirect(remove_query_arg( array( 'key', 'login' ))  );


wp_safe_redirect( site_url(remove_query_arg( array( 'key', 'login' )) ) );

Attachments (1)

46033.patch (555 bytes) - added by ayeshrajans 5 years ago.

Download all attachments as: .zip

Change History (5)

#1 @swissspidy
5 years ago

  • Component changed from General to Login and Registration
  • Keywords needs-patch needs-testing added; has-patch removed

#2 @ayeshrajans
5 years ago

Hi @tinodjwp - Welcome to WordPress Trac!
It would be helpful if you could mention a situation that the default site URL isn't working. However, I agree that using site_url allows to run the site_url filters, which a plugin in your situation might be using. Here is a patch with the changes you mentioned. Let's wait for an admin to review.

5 years ago

#3 @tinodjwp
5 years ago

Scenario/situation where I had issues was when Wordpress is installed behind reverse proxy. Then, here, it was taking internal instead of external site url, causing problems. Same problem is with #46037

Last edited 5 years ago by tinodjwp (previous) (diff)

#4 @ayeshrajans
5 years ago

  • Keywords needs-patch removed
Note: See TracTickets for help on using tickets.