get_subdirectory_reserved_names example

$blog   = $_POST['blog'];
    $domain = '';

    $blog['domain'] = trim( $blog['domain'] );
    if ( preg_match( '|^([a-zA-Z0-9-])+$|', $blog['domain'] ) ) {
        $domain = strtolower( $blog['domain'] );
    }

    // If not a subdomain installation, make sure the domain isn't a reserved word.     if ( ! is_subdomain_install() ) {
        $subdirectory_reserved_names = get_subdirectory_reserved_names();

        if ( in_array( $domain$subdirectory_reserved_names, true ) ) {
            wp_die(
                sprintf(
                    /* translators: %s: Reserved names list. */
                    __( 'The following words are reserved for use by WordPress functions and cannot be used as site names: %s' ),
                    '<code>' . implode( '</code>, <code>', $subdirectory_reserved_names ) . '</code>'
                )
            );
        }
    }

    
$illegal_names = get_site_option( 'illegal_names' );
    if ( false == $illegal_names ) {
        $illegal_names = array( 'www', 'web', 'root', 'admin', 'main', 'invite', 'administrator' );
        add_site_option( 'illegal_names', $illegal_names );
    }

    /* * On sub dir installations, some names are so illegal, only a filter can * spring them from jail. */
    if ( ! is_subdomain_install() ) {
        $illegal_names = array_merge( $illegal_namesget_subdirectory_reserved_names() );
    }

    if ( empty( $blogname ) ) {
        $errors->add( 'blogname', __( 'Please enter a site name.' ) );
    }

    if ( preg_match( '/[^a-z0-9]+/', $blogname ) ) {
        $errors->add( 'blogname', __( 'Site names can only contain lowercase letters (a-z) and numbers.' ) );
    }

    if ( in_array( $blogname$illegal_names, true ) ) {
        
Home | Imprint | This part of the site doesn't use cookies.