Index: src/wp-admin/themes.php =================================================================== --- src/wp-admin/themes.php (revision 33852) +++ src/wp-admin/themes.php (working copy) @@ -9,15 +9,23 @@ /** WordPress Administration Bootstrap */ require_once( dirname( __FILE__ ) . '/admin.php' ); -if ( !current_user_can('switch_themes') && !current_user_can('edit_theme_options') ) - wp_die( __( 'Cheatin’ uh?' ), 403 ); +if ( ! current_user_can('switch_themes') && ! current_user_can('edit_theme_options') ) { + wp_die( + '
' . __( 'You are not allowed to manage these items.' ) . '
', + 403 ); +} if ( current_user_can( 'switch_themes' ) && isset($_GET['action'] ) ) { if ( 'activate' == $_GET['action'] ) { check_admin_referer('switch-theme_' . $_GET['stylesheet']); $theme = wp_get_theme( $_GET['stylesheet'] ); - if ( ! $theme->exists() || ! $theme->is_allowed() ) - wp_die( __( 'Cheatin’ uh?' ), 403 ); + if ( ! $theme->exists() || ! $theme->is_allowed() ) { + wp_die( + '' . __( 'The requested theme does not exist.' ) . '
', + 403 ); + } switch_theme( $theme->get_stylesheet() ); wp_redirect( admin_url('themes.php?activated=true') ); exit; @@ -24,8 +32,18 @@ } elseif ( 'delete' == $_GET['action'] ) { check_admin_referer('delete-theme_' . $_GET['stylesheet']); $theme = wp_get_theme( $_GET['stylesheet'] ); - if ( !current_user_can('delete_themes') || ! $theme->exists() ) - wp_die( __( 'Cheatin’ uh?' ), 403 ); + if ( ! current_user_can('delete_themes') ) { + wp_die( + '' . __( 'You are not allowed to delete this item.' ) . '
', + 403 ); + } + if ( ! $theme->exists() ) { + wp_die( + '' . __( 'The requested theme does not exist.' ) . '
', + 403 ); + } $active = wp_get_theme(); if ( $active->get( 'Template' ) == $_GET['stylesheet'] ) { wp_redirect( admin_url( 'themes.php?delete-active-child=true' ) );