WordPress.org

Make WordPress Core

Opened 9 months ago

Last modified 9 months ago

#46033 new defect (bug)

Please fix redirect in wp-login.php

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

Description

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

<?php
wp_safe_redirect(remove_query_arg( array( 'key', 'login' ))  );

with

<?php
wp_safe_redirect( site_url(remove_query_arg( array( 'key', 'login' )) ) );

Attachments (1)

46033.patch (555 bytes) - added by ayeshrajans 9 months ago.

Download all attachments as: .zip

Change History (5)

#1 @swissspidy
9 months ago

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

#2 @ayeshrajans
9 months 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.

@ayeshrajans
9 months ago

#3 @tinodjwp
9 months 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 9 months ago by tinodjwp (previous) (diff)

#4 @ayeshrajans
9 months ago

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