mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-12 21:00:21 +00:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@33144 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -42,6 +42,10 @@ if ( ! $id ) {
|
||||
}
|
||||
|
||||
$details = get_blog_details( $id );
|
||||
if ( ! $details ) {
|
||||
wp_die( __( 'The requested site does not exist.' ) );
|
||||
}
|
||||
|
||||
if ( ! can_edit_network( $details->site_id ) ) {
|
||||
wp_die( __( 'You do not have permission to access this page.' ), 403 );
|
||||
}
|
||||
|
||||
@@ -39,6 +39,10 @@ if ( ! $id )
|
||||
wp_die( __('Invalid site ID.') );
|
||||
|
||||
$details = get_blog_details( $id );
|
||||
if ( ! $details ) {
|
||||
wp_die( __( 'The requested site does not exist.' ) );
|
||||
}
|
||||
|
||||
if ( !can_edit_network( $details->site_id ) )
|
||||
wp_die( __( 'You do not have permission to access this page.' ), 403 );
|
||||
|
||||
|
||||
@@ -56,6 +56,10 @@ if ( ! $id )
|
||||
$wp_list_table->prepare_items();
|
||||
|
||||
$details = get_blog_details( $id );
|
||||
if ( ! $details ) {
|
||||
wp_die( __( 'The requested site does not exist.' ) );
|
||||
}
|
||||
|
||||
if ( !can_edit_network( $details->site_id ) )
|
||||
wp_die( __( 'You do not have permission to access this page.' ), 403 );
|
||||
|
||||
|
||||
@@ -49,6 +49,10 @@ if ( ! $id )
|
||||
wp_die( __('Invalid site ID.') );
|
||||
|
||||
$details = get_blog_details( $id );
|
||||
if ( ! $details ) {
|
||||
wp_die( __( 'The requested site does not exist' ) );
|
||||
}
|
||||
|
||||
if ( ! can_edit_network( $details->site_id ) )
|
||||
wp_die( __( 'You do not have permission to access this page.' ), 403 );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user