Make WordPress Core

Changeset 33144


Ignore:
Timestamp:
07/09/2015 04:28:42 PM (11 years ago)
Author:
jeremyfelt
Message:

Avoid PHP notice when attempting to edit a site that does not exist.

Show a more explicit error - "The requested site does not exist."

Fixes #32934.

Location:
trunk/src/wp-admin/network
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/network/site-info.php

    r32974 r33144  
    4343
    4444$details = get_blog_details( $id );
     45if ( ! $details ) {
     46    wp_die( __( 'The requested site does not exist.' ) );
     47}
     48
    4549if ( ! can_edit_network( $details->site_id ) ) {
    4650    wp_die( __( 'You do not have permission to access this page.' ), 403 );
  • trunk/src/wp-admin/network/site-settings.php

    r32974 r33144  
    4040
    4141$details = get_blog_details( $id );
     42if ( ! $details ) {
     43    wp_die( __( 'The requested site does not exist.' ) );
     44}
     45
    4246if ( !can_edit_network( $details->site_id ) )
    4347    wp_die( __( 'You do not have permission to access this page.' ), 403 );
  • trunk/src/wp-admin/network/site-themes.php

    r32974 r33144  
    5757
    5858$details = get_blog_details( $id );
     59if ( ! $details ) {
     60    wp_die( __( 'The requested site does not exist.' ) );
     61}
     62
    5963if ( !can_edit_network( $details->site_id ) )
    6064    wp_die( __( 'You do not have permission to access this page.' ), 403 );
  • trunk/src/wp-admin/network/site-users.php

    r32974 r33144  
    5050
    5151$details = get_blog_details( $id );
     52if ( ! $details ) {
     53    wp_die( __( 'The requested site does not exist' ) );
     54}
     55
    5256if ( ! can_edit_network( $details->site_id ) )
    5357    wp_die( __( 'You do not have permission to access this page.' ), 403 );
Note: See TracChangeset for help on using the changeset viewer.