WordPress.org

Make WordPress Core

Ticket #44808: 44808.patch

File 44808.patch, 518 bytes (added by dharmin16, 11 months ago)

Add domain into trim function to trim spaces if added by mistake.

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

    diff --git a/src/wp-admin/network/site-new.php b/src/wp-admin/network/site-new.php
    index 70d9f1c..307c11a 100644
    a b if ( isset( $_REQUEST['action'] ) && 'add-site' == $_REQUEST['action'] ) { 
    4242
    4343        $blog   = $_POST['blog'];
    4444        $domain = '';
    45         if ( preg_match( '|^([a-zA-Z0-9-])+$|', $blog['domain'] ) ) {
     45        if ( preg_match( '|^([a-zA-Z0-9-])+$|', trim( $blog['domain'] ) ) ) {
    4646                $domain = strtolower( $blog['domain'] );
    4747        }
    4848