WordPress.org

Make WordPress Core

Ticket #18777: filterpatch.diff

File filterpatch.diff, 732 bytes (added by TJNowell, 10 years ago)

Patch for site-new.php

  • wp-admin/network/site-new.php

     
    3333        if ( ! is_array( $_POST['blog'] ) )
    3434                wp_die( __( 'Can’t create an empty site.' ) );
    3535        $blog = $_POST['blog'];
     36
    3637        $domain = '';
    37         if ( preg_match( '|^([a-zA-Z0-9-])+$|', $blog['domain'] ) )
     38
     39        $validdomain = preg_match( '|^([a-zA-Z0-9-])+$|', $blog['domain'] );
     40        $validdomain = apply_filters('add_site_valid_address', $validdomain, $blog['domain']);
     41        if($validdomain)
    3842                $domain = strtolower( $blog['domain'] );
    3943
    4044        // If not a subdomain install, make sure the domain isn't a reserved word