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:
Jeremy Felt
2015-07-09 16:28:42 +00:00
parent bb7f147703
commit 8b9b56f59f
4 changed files with 16 additions and 0 deletions
+4
View File
@@ -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 );
}
+4
View File
@@ -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 );
+4
View File
@@ -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 );
+4
View File
@@ -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 );