Make WordPress Core

Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#31896 closed defect (bug) (fixed)

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

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


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

Attachments (3)

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

Download all attachments as: .zip

Change History (13)

9 years ago

#1 @ericlewis
9 years ago

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

9 years ago

#2 @westonruter
9 years ago

  • Version set to trunk

Related: #31782

#3 @westonruter
9 years ago

  • Keywords needs-patch added

#4 @ericlewis
9 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
9 years ago

  • Keywords has-patch added; needs-patch removed

#6 @DrewAPicture
9 years ago

  • Priority changed from normal to high

#7 @ocean90
9 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
9 years ago

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

9 years ago

#9 @ocean90
9 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
9 years ago

In 32134:

Customizer: Escape theme preview URLs.

props johnbillion, ocean90.
see #31896.

Note: See TracTickets for help on using tickets.