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.

Built from https://develop.svn.wordpress.org/trunk@33144


git-svn-id: http://core.svn.wordpress.org/trunk@33115 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Jeremy Felt 2015-07-09 16:29:24 +00:00
parent 0bc0b0c917
commit eb26a74073
5 changed files with 17 additions and 1 deletions

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 );
}

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 );

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 );

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 );

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.3-beta2-33143';
$wp_version = '4.3-beta2-33144';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.