Changeset 33866
- Timestamp:
- 09/02/2015 06:44:07 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/themes.php
r33820 r33866 10 10 require_once( dirname( __FILE__ ) . '/admin.php' ); 11 11 12 if ( !current_user_can('switch_themes') && !current_user_can('edit_theme_options') ) 13 wp_die( __( 'Cheatin’ uh?' ), 403 ); 12 if ( ! current_user_can( 'switch_themes' ) && ! current_user_can( 'edit_theme_options' ) ) { 13 wp_die( 14 '<h1>' . __( 'Cheatin’ uh?' ) . '</h1>' . 15 '<p>' . __( 'You are not allowed to edit theme options on this site.' ) . '</p>', 16 403 17 ); 18 } 14 19 15 20 if ( current_user_can( 'switch_themes' ) && isset($_GET['action'] ) ) { … … 17 22 check_admin_referer('switch-theme_' . $_GET['stylesheet']); 18 23 $theme = wp_get_theme( $_GET['stylesheet'] ); 19 if ( ! $theme->exists() || ! $theme->is_allowed() ) 20 wp_die( __( 'Cheatin’ uh?' ), 403 ); 24 25 if ( ! $theme->exists() || ! $theme->is_allowed() ) { 26 wp_die( 27 '<h1>' . __( 'Cheatin’ uh?' ) . '</h1>' . 28 '<p>' . __( 'The requested theme does not exist.' ) . '</p>', 29 403 30 ); 31 } 32 21 33 switch_theme( $theme->get_stylesheet() ); 22 34 wp_redirect( admin_url('themes.php?activated=true') ); … … 25 37 check_admin_referer('delete-theme_' . $_GET['stylesheet']); 26 38 $theme = wp_get_theme( $_GET['stylesheet'] ); 27 if ( !current_user_can('delete_themes') || ! $theme->exists() ) 28 wp_die( __( 'Cheatin’ uh?' ), 403 ); 39 40 if ( ! current_user_can( 'delete_themes' ) ) { 41 wp_die( 42 '<h1>' . __( 'Cheatin’ uh?' ) . '</h1>' . 43 '<p>' . __( 'You are not allowed to delete this item.' ) . '</p>', 44 403 45 ); 46 } 47 48 if ( ! $theme->exists() ) { 49 wp_die( 50 '<h1>' . __( 'Cheatin’ uh?' ) . '</h1>' . 51 '<p>' . __( 'The requested theme does not exist.' ) . '</p>', 52 403 53 ); 54 } 55 29 56 $active = wp_get_theme(); 30 57 if ( $active->get( 'Template' ) == $_GET['stylesheet'] ) {
Note: See TracChangeset
for help on using the changeset viewer.