WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#31896 closed defect (bug) (fixed)

Customizer Theme Switcher: Live previewing a theme breaks on subfolder installs

Reported by: ericlewis Owned by: ocean90
Milestone: 4.2 Priority: high
Severity: normal Version: 4.2
Component: Customize Keywords: has-patch
Focuses: Cc:

Description

Live previewing a theme on a subfolder install (e.g. site.com/wordpress) breaks, and will send you to a 404 page.

Attachments (3)

31889.mp4 (820.6 KB) - added by ericlewis 4 years ago.
31896.diff (928 bytes) - added by ericlewis 4 years ago.
31896.2.diff (816 bytes) - added by ocean90 4 years ago.

Download all attachments as: .zip

Change History (13)

@ericlewis
4 years ago

#1 @ericlewis
4 years ago

In attachment:31889.mp4, a screencast of the bug.

@ericlewis
4 years ago

#2 @westonruter
4 years ago

  • Version set to trunk

Related: #31782

#3 @westonruter
4 years ago

  • Keywords needs-patch added

#4 @ericlewis
4 years ago

This is because of the way the URL is being built for the theme preview link.

I've modified this logic appropriately in attachment:31896.diff

#5 @ericlewis
4 years ago

  • Keywords has-patch added; needs-patch removed

#6 @DrewAPicture
4 years ago

  • Priority changed from normal to high

#7 @ocean90
4 years ago

I think this can be simplified to set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] ), see 31896.2.diff.

#8 @DrewAPicture
4 years ago

  • Owner set to ocean90
  • Status changed from new to assigned

@ocean90
4 years ago

#9 @ocean90
4 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 32086:

Customizer Theme Switcher: Fix preview URL for subfolder installs.

Use $_SERVER['HTTP_HOST'] and $_SERVER['REQUEST_URI'] instead of site_url() and $_SERVER['REQUEST_URI'].

fixes #31896.

#10 @ocean90
4 years ago

In 32134:

Customizer: Escape theme preview URLs.

props johnbillion, ocean90.
see #31896.

Note: See TracTickets for help on using tickets.