mirror of
https://github.com/WordPress/WordPress.git
synced 2025-04-07 12:35:55 +02:00
Themes: Account for uppercase chars when managing themes.
Fixes a bug where the UI wasn't updated after deleting/updating a theme. Also introduces unit tests for theme management ajax handlers. For now they're focused on `wp_ajax_update_theme()` but they can include tests for other handlers as well. Props chrisjean for initial patch. Fixes #37924. Built from https://develop.svn.wordpress.org/trunk@38710 git-svn-id: http://core.svn.wordpress.org/trunk@38653 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
6a2d446d9c
commit
6335e08ab2
@ -3405,7 +3405,7 @@ function wp_ajax_update_theme() {
|
|||||||
) );
|
) );
|
||||||
}
|
}
|
||||||
|
|
||||||
$stylesheet = sanitize_key( wp_unslash( $_POST['slug'] ) );
|
$stylesheet = preg_replace( '/[^A-z0-9_\-]/', '', wp_unslash( $_POST['slug'] ) );
|
||||||
$status = array(
|
$status = array(
|
||||||
'update' => 'theme',
|
'update' => 'theme',
|
||||||
'slug' => $stylesheet,
|
'slug' => $stylesheet,
|
||||||
@ -3490,7 +3490,7 @@ function wp_ajax_delete_theme() {
|
|||||||
) );
|
) );
|
||||||
}
|
}
|
||||||
|
|
||||||
$stylesheet = sanitize_key( wp_unslash( $_POST['slug'] ) );
|
$stylesheet = preg_replace( '/[^A-z0-9_\-]/', '', wp_unslash( $_POST['slug'] ) );
|
||||||
$status = array(
|
$status = array(
|
||||||
'delete' => 'theme',
|
'delete' => 'theme',
|
||||||
'slug' => $stylesheet,
|
'slug' => $stylesheet,
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '4.7-alpha-38709';
|
$wp_version = '4.7-alpha-38710';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
Loading…
Reference in New Issue
Block a user