Theme preview not working
|Reported by:||Denis-de-Bernardy||Owned by:||anonymous|
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.