Make WordPress Core

Ticket #14530: 14530-4.patch

File 14530-4.patch, 13.5 KB (added by lukecarbis, 10 years ago)

Change "Cheatin', uh?" to "You do not have permission to access this page."

  • wp-admin/options.php

     
    4545}
    4646
    4747if ( !current_user_can( $capability ) )
    48         wp_die( __( 'Cheatin’ uh?' ), 403 );
     48        wp_die( __( 'You do not have permission to access this page.' ), 403 );
    4949
    5050// Handle admin email change requests
    5151if ( is_multisite() ) {
     
    6969}
    7070
    7171if ( is_multisite() && !is_super_admin() && 'update' != $action )
    72         wp_die( __( 'Cheatin’ uh?' ), 403 );
     72        wp_die( __( 'You do not have permission to access this page.' ), 403 );
    7373
    7474$whitelist_options = array(
    7575        'general' => array( 'blogname', 'blogdescription', 'gmt_offset', 'date_format', 'time_format', 'start_of_week', 'timezone_string', 'WPLANG' ),
  • wp-admin/edit-tags.php

     
    1818        wp_die( __( 'Invalid taxonomy' ) );
    1919
    2020if ( ! current_user_can( $tax->cap->manage_terms ) )
    21         wp_die( __( 'Cheatin’ uh?' ), 403 );
     21        wp_die( __( 'You do not have permission to access this page.' ), 403 );
    2222
    2323// $post_type is set when the WP_Terms_List_Table instance is created
    2424global $post_type;
     
    5050        check_admin_referer( 'add-tag', '_wpnonce_add-tag' );
    5151
    5252        if ( !current_user_can( $tax->cap->edit_terms ) )
    53                 wp_die( __( 'Cheatin’ uh?' ), 403 );
     53                wp_die( __( 'You do not have permission to access this page.' ), 403 );
    5454
    5555        $ret = wp_insert_term( $_POST['tag-name'], $taxonomy, $_POST );
    5656        $location = 'edit-tags.php?taxonomy=' . $taxonomy;
     
    8686        check_admin_referer( 'delete-tag_' . $tag_ID );
    8787
    8888        if ( !current_user_can( $tax->cap->delete_terms ) )
    89                 wp_die( __( 'Cheatin’ uh?' ), 403 );
     89                wp_die( __( 'You do not have permission to access this page.' ), 403 );
    9090
    9191        wp_delete_term( $tag_ID, $taxonomy );
    9292
     
    9898        check_admin_referer( 'bulk-tags' );
    9999
    100100        if ( !current_user_can( $tax->cap->delete_terms ) )
    101                 wp_die( __( 'Cheatin’ uh?' ), 403 );
     101                wp_die( __( 'You do not have permission to access this page.' ), 403 );
    102102
    103103        $tags = (array) $_REQUEST['delete_tags'];
    104104        foreach ( $tags as $tag_ID ) {
     
    136136        check_admin_referer( 'update-tag_' . $tag_ID );
    137137
    138138        if ( !current_user_can( $tax->cap->edit_terms ) )
    139                 wp_die( __( 'Cheatin’ uh?' ), 403 );
     139                wp_die( __( 'You do not have permission to access this page.' ), 403 );
    140140
    141141        $tag = get_term( $tag_ID, $taxonomy );
    142142        if ( ! $tag )
  • wp-admin/post-new.php

     
    5050$editing = true;
    5151
    5252if ( ! current_user_can( $post_type_object->cap->edit_posts ) || ! current_user_can( $post_type_object->cap->create_posts ) )
    53         wp_die( __( 'Cheatin’ uh?' ), 403 );
     53        wp_die( __( 'You do not have permission to access this page.' ), 403 );
    5454
    5555// Schedule auto-draft cleanup
    5656if ( ! wp_next_scheduled( 'wp_scheduled_auto_draft_delete' ) )
  • wp-admin/network/site-users.php

     
    133133
    134134                                        // If the user doesn't already belong to the blog, bail.
    135135                                        if ( !is_user_member_of_blog( $user_id ) )
    136                                                 wp_die( __( 'Cheatin’ uh?' ), 403 );
     136                                                wp_die( __( 'You do not have permission to access this page.' ), 403 );
    137137
    138138                                        $user = get_userdata( $user_id );
    139139                                        $user->set_role( $_REQUEST['new_role'] );
  • wp-admin/includes/bookmark.php

     
    2727 */
    2828function edit_link( $link_id = 0 ) {
    2929        if ( !current_user_can( 'manage_links' ) )
    30                 wp_die( __( 'Cheatin’ uh?' ), 403 );
     30                wp_die( __( 'You do not have permission to access this page.' ), 403 );
    3131
    3232        $_POST['link_url'] = esc_html( $_POST['link_url'] );
    3333        $_POST['link_url'] = esc_url($_POST['link_url']);
  • wp-admin/edit-comments.php

     
    99/** WordPress Administration Bootstrap */
    1010require_once( dirname( __FILE__ ) . '/admin.php' );
    1111if ( !current_user_can('edit_posts') )
    12         wp_die( __( 'Cheatin’ uh?' ), 403 );
     12        wp_die( __( 'You do not have permission to access this page.' ), 403 );
    1313
    1414$wp_list_table = _get_list_table('WP_Comments_List_Table');
    1515$pagenum = $wp_list_table->get_pagenum();
  • wp-admin/press-this.php

     
    1414header('Content-Type: ' . get_option('html_type') . '; charset=' . get_option('blog_charset'));
    1515
    1616if ( ! current_user_can( 'edit_posts' ) || ! current_user_can( get_post_type_object( 'post' )->cap->create_posts ) )
    17         wp_die( __( 'Cheatin’ uh?' ), 403 );
     17        wp_die( __( 'You do not have permission to access this page.' ), 403 );
    1818
    1919/**
    2020 * Press It form handler.
  • wp-admin/media-upload.php

     
    3232
    3333// Require an ID for the edit screen.
    3434if ( isset($action) && $action == 'edit' && !$ID ) {
    35         wp_die( __( 'Cheatin’ uh?' ), 403 );
     35        wp_die( __( 'You do not have permission to access this page.' ), 403 );
    3636}
    3737
    3838if ( ! empty( $_REQUEST['post_id'] ) && ! current_user_can( 'edit_post' , $_REQUEST['post_id'] ) ) {
    39         wp_die( __( 'Cheatin’ uh?' ), 403 );
     39        wp_die( __( 'You do not have permission to access this page.' ), 403 );
    4040}
    4141
    4242// Upload type: image, video, file, ..?
  • wp-admin/themes.php

     
    1010require_once( dirname( __FILE__ ) . '/admin.php' );
    1111
    1212if ( !current_user_can('switch_themes') && !current_user_can('edit_theme_options') )
    13         wp_die( __( 'Cheatin’ uh?' ), 403 );
     13        wp_die( __( 'You do not have permission to access this page.' ), 403 );
    1414
    1515if ( current_user_can( 'switch_themes' ) && isset($_GET['action'] ) ) {
    1616        if ( 'activate' == $_GET['action'] ) {
    1717                check_admin_referer('switch-theme_' . $_GET['stylesheet']);
    1818                $theme = wp_get_theme( $_GET['stylesheet'] );
    1919                if ( ! $theme->exists() || ! $theme->is_allowed() )
    20                         wp_die( __( 'Cheatin’ uh?' ), 403 );
     20                        wp_die( __( 'You do not have permission to access this page.' ), 403 );
    2121                switch_theme( $theme->get_stylesheet() );
    2222                wp_redirect( admin_url('themes.php?activated=true') );
    2323                exit;
     
    2525                check_admin_referer('delete-theme_' . $_GET['stylesheet']);
    2626                $theme = wp_get_theme( $_GET['stylesheet'] );
    2727                if ( !current_user_can('delete_themes') || ! $theme->exists() )
    28                         wp_die( __( 'Cheatin’ uh?' ), 403 );
     28                        wp_die( __( 'You do not have permission to access this page.' ), 403 );
    2929                $active = wp_get_theme();
    3030                if ( $active->get( 'Template' ) == $_GET['stylesheet'] ) {
    3131                        wp_redirect( admin_url( 'themes.php?delete-active-child=true' ) );
  • wp-admin/nav-menus.php

     
    2020
    2121// Permissions Check
    2222if ( ! current_user_can('edit_theme_options') )
    23         wp_die( __( 'Cheatin’ uh?' ), 403 );
     23        wp_die( __( 'You do not have permission to access this page.' ), 403 );
    2424
    2525wp_enqueue_script( 'nav-menu' );
    2626
  • wp-admin/edit.php

     
    2727        wp_die( __( 'Invalid post type' ) );
    2828
    2929if ( ! current_user_can( $post_type_object->cap->edit_posts ) )
    30         wp_die( __( 'Cheatin’ uh?' ), 403 );
     30        wp_die( __( 'You do not have permission to access this page.' ), 403 );
    3131
    3232$wp_list_table = _get_list_table('WP_Posts_List_Table');
    3333$pagenum = $wp_list_table->get_pagenum();
  • wp-admin/custom-header.php

     
    682682        public function step_2() {
    683683                check_admin_referer('custom-header-upload', '_wpnonce-custom-header-upload');
    684684                if ( ! current_theme_supports( 'custom-header', 'uploads' ) )
    685                         wp_die( __( 'Cheatin’ uh?' ), 403 );
     685                        wp_die( __( 'You do not have permission to access this page.' ), 403 );
    686686
    687687                if ( empty( $_POST ) && isset( $_GET['file'] ) ) {
    688688                        $attachment_id = absint( $_GET['file'] );
     
    833833                check_admin_referer( 'custom-header-crop-image' );
    834834
    835835                if ( ! current_theme_supports( 'custom-header', 'uploads' ) )
    836                         wp_die( __( 'Cheatin’ uh?' ), 403 );
     836                        wp_die( __( 'You do not have permission to access this page.' ), 403 );
    837837
    838838                if ( ! empty( $_POST['skip-cropping'] ) && ! ( current_theme_supports( 'custom-header', 'flex-height' ) || current_theme_supports( 'custom-header', 'flex-width' ) ) )
    839                         wp_die( __( 'Cheatin’ uh?' ), 403 );
     839                        wp_die( __( 'You do not have permission to access this page.' ), 403 );
    840840
    841841                if ( $_POST['oitar'] > 1 ) {
    842842                        $_POST['x1'] = $_POST['x1'] * $_POST['oitar'];
  • wp-admin/widgets.php

     
    1313require_once(ABSPATH . 'wp-admin/includes/widgets.php');
    1414
    1515if ( ! current_user_can('edit_theme_options') )
    16         wp_die( __( 'Cheatin’ uh?' ), 403 );
     16        wp_die( __( 'You do not have permission to access this page.' ), 403 );
    1717
    1818$widgets_access = get_user_setting( 'widgets_access' );
    1919if ( isset($_GET['widgets-access']) ) {
  • wp-includes/class-wp-customize-manager.php

     
    144144                        wp_die( $ajax_message );
    145145
    146146                if ( ! $message )
    147                         $message = __( 'Cheatin’ uh?' );
     147                        $message = __( 'You do not have permission to access this page.' );
    148148
    149149                wp_die( $message );
    150150        }
  • wp-admin/users.php

     
    1010require_once( dirname( __FILE__ ) . '/admin.php' );
    1111
    1212if ( ! current_user_can( 'list_users' ) )
    13         wp_die( __( 'Cheatin’ uh?' ), 403 );
     13        wp_die( __( 'You do not have permission to access this page.' ), 403 );
    1414
    1515$wp_list_table = _get_list_table('WP_Users_List_Table');
    1616$pagenum = $wp_list_table->get_pagenum();
     
    128128
    129129                // If the user doesn't already belong to the blog, bail.
    130130                if ( is_multisite() && !is_user_member_of_blog( $id ) )
    131                         wp_die( __( 'Cheatin’ uh?' ), 403 );
     131                        wp_die( __( 'You do not have permission to access this page.' ), 403 );
    132132
    133133                $user = get_userdata( $id );
    134134                $user->set_role($_REQUEST['new_role']);
  • wp-includes/script-loader.php

     
    392392                'saved'     => __( 'Saved' ),
    393393                'cancel'    => __( 'Cancel' ),
    394394                'close'     => __( 'Close' ),
    395                 'cheatin'   => __( 'Cheatin’ uh?' ),
     395                'cheatin'   => __( 'You do not have permission to access this page.' ),
    396396
    397397                // Used for overriding the file types allowed in plupload.
    398398                'allowedFiles' => __( 'Allowed Files' ),
  • wp-admin/user-new.php

     
    1111
    1212if ( is_multisite() ) {
    1313        if ( ! current_user_can( 'create_users' ) && ! current_user_can( 'promote_users' ) )
    14                 wp_die( __( 'Cheatin’ uh?' ), 403 );
     14                wp_die( __( 'You do not have permission to access this page.' ), 403 );
    1515} elseif ( ! current_user_can( 'create_users' ) ) {
    16         wp_die( __( 'Cheatin’ uh?' ), 403 );
     16        wp_die( __( 'You do not have permission to access this page.' ), 403 );
    1717}
    1818
    1919if ( is_multisite() ) {
     
    5555        }
    5656
    5757        if ( ! current_user_can('promote_user', $user_details->ID) )
    58                 wp_die( __( 'Cheatin’ uh?' ), 403 );
     58                wp_die( __( 'You do not have permission to access this page.' ), 403 );
    5959
    6060        // Adding an existing user to this blog
    6161        $new_user_email = $user_details->user_email;
     
    9292        check_admin_referer( 'create-user', '_wpnonce_create-user' );
    9393
    9494        if ( ! current_user_can('create_users') )
    95                 wp_die( __( 'Cheatin’ uh?' ), 403 );
     95                wp_die( __( 'You do not have permission to access this page.' ), 403 );
    9696
    9797        if ( ! is_multisite() ) {
    9898                $user_id = edit_user();
  • wp-admin/customize.php

     
    1313require_once( dirname( __FILE__ ) . '/admin.php' );
    1414
    1515if ( ! current_user_can( 'customize' ) ) {
    16         wp_die( __( 'Cheatin’ uh?' ), 403 );
     16        wp_die( __( 'You do not have permission to access this page.' ), 403 );
    1717}
    1818
    1919wp_reset_vars( array( 'url', 'return' ) );