Make WordPress Core

Opened 7 years ago

Closed 7 years ago

Last modified 5 months ago

#9329 closed defect (bug) (duplicate)

Theme preview not working

Reported by: Denis-de-Bernardy Owned by:
Milestone: Priority: high
Severity: major Version: 2.7.1
Component: General Keywords: commit
Focuses: Cc:


I bumped into this odd bug, in preview_theme()

var_dump($_GET['template']); // foo-bar
	$_GET['template'] = preg_replace('|[^a-z0-9_.-/]|i', '', $_GET['template']);
var_dump($_GET['template']);die; // foobar

Platform is Apache 2.2 with php 5.2.6 on Leopard. I had ran into the issue in plugins in the past, but never in WP. Basically, it treats .-/ like a range, and changing it to ./- fixes the thing.

The fix is trivial, and is attached.

Attachments (1)

9329.diff (1004 bytes) - added by Denis-de-Bernardy 7 years ago.

Download all attachments as: .zip

Change History (4)

@Denis-de-Bernardy7 years ago

comment:1 @Denis-de-Bernardy7 years ago

  • Keywords commit added

comment:2 @filosofo7 years ago

  • Resolution set to duplicate
  • Status changed from new to closed

duplicate of #9244

comment:3 @DrewAPicture5 months ago

  • Milestone 2.7.2 deleted
Note: See TracTickets for help on using tickets.