Make WordPress Core


Ignore:
Timestamp:
03/05/2019 08:34:58 PM (5 years ago)
Author:
SergeyBiryukov
Message:

Networks and Sites: Check the result of get_site() in wp_insert_site().

Props davidbinda, vanyukov, lukecarbis.
Fixes #46300.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/ms-site.php

    r44727 r44799  
    6969
    7070    $new_site = get_site( $wpdb->insert_id );
     71
     72    if ( ! $new_site ) {
     73        return new WP_Error( 'get_site_error', __( 'Could not retrieve site data.' ) );
     74    }
    7175
    7276    clean_blog_cache( $new_site );
Note: See TracChangeset for help on using the changeset viewer.