mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 09:37:42 +01:00
Less confusing regex, props filosofo, fixes #9244
git-svn-id: http://svn.automattic.com/wordpress/trunk@10824 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
fb0c5fbe97
commit
c25364742c
@ -849,7 +849,7 @@ function preview_theme() {
|
||||
if ( !current_user_can( 'switch_themes' ) )
|
||||
return;
|
||||
|
||||
$_GET['template'] = preg_replace('|[^a-z0-9_.\-/]|i', '', $_GET['template']);
|
||||
$_GET['template'] = preg_replace('|[^a-z0-9_./-]|i', '', $_GET['template']);
|
||||
|
||||
if ( validate_file($_GET['template']) )
|
||||
return;
|
||||
@ -857,7 +857,7 @@ function preview_theme() {
|
||||
add_filter('template', create_function('', "return '{$_GET['template']}';") );
|
||||
|
||||
if ( isset($_GET['stylesheet']) ) {
|
||||
$_GET['stylesheet'] = preg_replace('|[^a-z0-9_.\-/]|i', '', $_GET['stylesheet']);
|
||||
$_GET['stylesheet'] = preg_replace('|[^a-z0-9_./-]|i', '', $_GET['stylesheet']);
|
||||
if ( validate_file($_GET['stylesheet']) )
|
||||
return;
|
||||
add_filter('stylesheet', create_function('', "return '{$_GET['stylesheet']}';") );
|
||||
|
Loading…
Reference in New Issue
Block a user