Make WordPress Core

Opened 6 years ago

Closed 6 years ago

#9329 closed defect (bug) (duplicate)

Theme preview not working

Reported by: Denis-de-Bernardy Owned by:
Milestone: 2.7.2 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 6 years ago.

Download all attachments as: .zip

Change History (3)

@Denis-de-Bernardy6 years ago

comment:1 @Denis-de-Bernardy6 years ago

  • Keywords commit added

comment:2 @filosofo6 years ago

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

duplicate of #9244

Note: See TracTickets for help on using tickets.