Make WordPress Core

Opened 15 years ago

Closed 15 years ago

#17243 closed defect (bug) (fixed)

wp_login_form: default for redirect leads to 404 on site in sub-folders

Reported by: esmi Owned by: nacin
Priority: normal Milestone: 3.3
Component: Template Version: 3.0
Severity: normal Keywords: has-patch
Cc: Focuses:

Description

When using wp_login_form in a site in a sub-folder (eg. /wordpress), the default redirect parameter (site_url( $_SERVERREQUEST_URI )) causes the redirect to duplicate the sub-folder in the url eg: http://example.com/wordpress/wordpress/

Replicated on 3.1.1 and 3.2 bleeding on 2 separate servers.

Attachments (1)

17243.diff (714 bytes ) - added by kawauso 15 years ago.
$_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']

Download all attachments as: .zip

Change History (8)

@kawauso
15 years ago

$_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']

#1 @kawauso
15 years ago

  • Keywords has-patch added

#2 @kawauso
15 years ago

  • Component GeneralTemplate
  • Version3.0

#3 @ZaneMatthew
15 years ago

  • Cc zanematthew@… added

#4 @SergeyBiryukov
15 years ago

  • Milestone Awaiting Review3.3

#5 @nacin
15 years ago

<input type="hidden" name="redirect_to" value="' . esc_attr( $args['redirect'] ) . '" />

Thinking that should be esc_url().

Or, if it should remain esc_attr() (and I don't think it should), then this patch should esc_url_raw() what we build from $_SERVER.

#6 @nacin
15 years ago

In [19032]:

Fix the current page default redirect in wp_login_form(). props kawauso, see #17243.

#7 @nacin
15 years ago

  • Owner set to nacin
  • Resolutionfixed
  • Status newclosed

In [19033]:

Use esc_url() rather than esc_attr() on a redirect-to URL. fixes #17243.

Note: See TracTickets for help on using tickets.