From ba056692a6d979f747ea3d9dd040a8ff466ce352 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Thu, 3 Sep 2015 09:21:23 +0000 Subject: [PATCH] Provide more helpful feedback than just "Cheatin' uh?" for permission errors in `wp-includes/class-wp-customize-manager.php`. props kraftbj. fixes #33684. see #14530. Built from https://develop.svn.wordpress.org/trunk@33889 git-svn-id: http://core.svn.wordpress.org/trunk@33858 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/class-wp-customize-manager.php | 10 +++++----- wp-includes/version.php | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/wp-includes/class-wp-customize-manager.php b/wp-includes/class-wp-customize-manager.php index 9cac338591..aed6324d0f 100644 --- a/wp-includes/class-wp-customize-manager.php +++ b/wp-includes/class-wp-customize-manager.php @@ -218,13 +218,13 @@ final class WP_Customize_Manager { if ( is_admin() && ! $doing_ajax_or_is_customized ) { auth_redirect(); } elseif ( $doing_ajax_or_is_customized && ! is_user_logged_in() ) { - $this->wp_die( 0 ); + $this->wp_die( 0, 'You must be logged in to complete this action.' ); } show_admin_bar( false ); if ( ! current_user_can( 'customize' ) ) { - $this->wp_die( -1 ); + $this->wp_die( -1, 'You are not allowed to customize the appearance of this site.' ); } $this->original_stylesheet = get_stylesheet(); @@ -238,17 +238,17 @@ final class WP_Customize_Manager { // If the requested theme is not the active theme and the user doesn't have the // switch_themes cap, bail. if ( ! current_user_can( 'switch_themes' ) ) { - $this->wp_die( -1 ); + $this->wp_die( -1, 'You are not allowed to edit theme options on this site.' ); } // If the theme has errors while loading, bail. if ( $this->theme()->errors() ) { - $this->wp_die( -1 ); + $this->wp_die( -1, $this->theme()->errors()->get_error_message() ); } // If the theme isn't allowed per multisite settings, bail. if ( ! $this->theme()->is_allowed() ) { - $this->wp_die( -1 ); + $this->wp_die( -1, 'The requested theme does not exist.' ); } } diff --git a/wp-includes/version.php b/wp-includes/version.php index c232e4898e..8bed03ed2b 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.4-alpha-33888'; +$wp_version = '4.4-alpha-33889'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.