WordPress.org

Make WordPress Core

Ticket #23709: subdomain_wildcard.patch

File subdomain_wildcard.patch, 1022 bytes (added by rinatkhaziev, 5 years ago)

Proposed patch for the ticket

  • wp-admin/includes/schema.php

     
    826826 * @return bool|WP_Error True on success, or WP_Error on warning (with the install otherwise successful,
    827827 *      so the error code must be checked) or failure.
    828828 */
    829 function populate_network( $network_id = 1, $domain = '', $email = '', $site_name = '', $path = '/', $subdomain_install = false ) {
     829function populate_network( $network_id = 1, $domain = '', $email = '', $site_name = '', $path = '/', $subdomain_install = false, $wildcard_check = true ) {
    830830        global $wpdb, $current_site, $wp_db_version, $wp_rewrite;
    831831
    832832        $errors = new WP_Error();
     
    948948                flush_rewrite_rules();
    949949        }
    950950
    951         if ( $subdomain_install ) {
     951        if ( $subdomain_install && $wildcard_check ) {
    952952                $vhost_ok = false;
    953953                $errstr = '';
    954954                $hostname = substr( md5( time() ), 0, 6 ) . '.' . $domain; // Very random hostname!