Make WordPress Core


Ignore:
Timestamp:
09/02/2015 06:30:58 PM (9 years ago)
Author:
SergeyBiryukov
Message:

Provide more helpful feedback than just "Cheatin' uh?" for permission errors in wp-admin/options.php.

props ericlewis, kraftbj, lukecarbis, mrmist.
fixes #33674. see #14530.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/options.php

    r33037 r33863  
    4545}
    4646
    47 if ( !current_user_can( $capability ) )
    48     wp_die( __( 'Cheatin’ uh?' ), 403 );
     47if ( ! current_user_can( $capability ) ) {
     48    wp_die(
     49        '<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' .
     50        '<p>' . __( 'You are not allowed to manage these items.' ) . '</p>',
     51        403
     52    );
     53}
    4954
    5055// Handle admin email change requests
     
    6974}
    7075
    71 if ( is_multisite() && !is_super_admin() && 'update' != $action )
    72     wp_die( __( 'Cheatin&#8217; uh?' ), 403 );
     76if ( is_multisite() && ! is_super_admin() && 'update' != $action ) {
     77    wp_die(
     78        '<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' .
     79        '<p>' . __( 'You are not allowed to delete these items.' ) . '</p>',
     80        403
     81    );
     82}
    7383
    7484$whitelist_options = array(
Note: See TracChangeset for help on using the changeset viewer.