mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 14:20:15 +00:00
Switch to a 403 response code in places where it is more appropriate than a 500 due to permissions errors.
Fixes #10551 Props nacin git-svn-id: https://develop.svn.wordpress.org/trunk@30356 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -10,14 +10,14 @@
|
||||
require_once( dirname( __FILE__ ) . '/admin.php' );
|
||||
|
||||
if ( !current_user_can('switch_themes') && !current_user_can('edit_theme_options') )
|
||||
wp_die( __( 'Cheatin’ uh?' ) );
|
||||
wp_die( __( 'Cheatin’ uh?' ), 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?' ) );
|
||||
wp_die( __( 'Cheatin’ uh?' ), 403 );
|
||||
switch_theme( $theme->get_stylesheet() );
|
||||
wp_redirect( admin_url('themes.php?activated=true') );
|
||||
exit;
|
||||
@@ -25,7 +25,7 @@ if ( current_user_can( 'switch_themes' ) && isset($_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?' ) );
|
||||
wp_die( __( 'Cheatin’ uh?' ), 403 );
|
||||
delete_theme($_GET['stylesheet']);
|
||||
wp_redirect( admin_url('themes.php?deleted=true') );
|
||||
exit;
|
||||
|
||||
Reference in New Issue
Block a user