nonce checks for ms themes. see #15969

git-svn-id: http://svn.automattic.com/wordpress/trunk@17122 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2010-12-23 16:20:36 +00:00
parent 602c7e4762
commit 7d88a90a22
1 changed files with 4 additions and 0 deletions

View File

@ -34,18 +34,21 @@ if ( $action ) {
$allowed_themes = get_site_option( 'allowedthemes' );
switch ( $action ) {
case 'enable':
check_admin_referer('enable-theme_' . $_GET['theme']);
$allowed_themes[ $_GET['theme'] ] = true;
update_site_option( 'allowedthemes', $allowed_themes );
wp_redirect( wp_get_referer() ); // @todo add_query_arg for update message
exit;
break;
case 'disable':
check_admin_referer('disable-theme_' . $_GET['theme']);
unset( $allowed_themes[ $_GET['theme'] ] );
update_site_option( 'allowedthemes', $allowed_themes );
wp_redirect( wp_get_referer() ); // @todo add_query_arg for update message
exit;
break;
case 'enable-selected':
check_admin_referer('bulk-themes');
$themes = isset( $_POST['checked'] ) ? (array) $_POST['checked'] : array();
if ( empty($themes) ) {
wp_redirect( wp_get_referer() );
@ -56,6 +59,7 @@ if ( $action ) {
update_site_option( 'allowedthemes', $allowed_themes );
break;
case 'disable-selected':
check_admin_referer('bulk-themes');
$themes = isset( $_POST['checked'] ) ? (array) $_POST['checked'] : array();
if ( empty($themes) ) {
wp_redirect( wp_get_referer() );