Ticket #42072: 42072.4.diff
File 42072.4.diff, 2.3 KB (added by , 7 years ago) |
---|
-
src/wp-includes/ms-functions.php
1356 1356 */ 1357 1357 function domain_exists( $domain, $path, $network_id = 1 ) { 1358 1358 $path = trailingslashit( $path ); 1359 $args = array( 1360 'network_id' => $network_id, 1361 'domain' => $domain, 1362 'path' => $path, 1363 'fields' => 'ids', 1364 ); 1365 $result = get_sites( $args ); 1366 $result = array_shift( $result ); 1359 $url = $domain . '/' . ltrim( $path, '/' ); 1360 1361 $result = get_site_by( 'url', $url, $network_id ); 1362 1363 if ( $result ) { 1364 $result = $result->blog_id; 1365 } 1367 1366 1368 1367 /** 1369 1368 * Filters whether a site name is taken. -
tests/phpunit/tests/multisite/getSiteBy.php
27 27 'wordpress.org/' => array( 'domain' => 'wordpress.org', 'path' => '/', 'site_id' => self::$network_ids['wordpress.org/'] ), 28 28 'foo.wordpress.org/' => array( 'domain' => 'foo.wordpress.org', 'path' => '/', 'site_id' => self::$network_ids['wordpress.org/'] ), 29 29 'wordpress.org/foo/' => array( 'domain' => 'wordpress.org', 'path' => '/foo/', 'site_id' => self::$network_ids['wordpress.org/'] ), 30 'www.wordpress.org/' => array( 'domain' => 'www.wordpress.org', 'path' => '/', 'site_id' => self::$network_ids['wordpress.org/'] ),31 30 'www.wordpress.net/' => array( 'domain' => 'www.wordpress.net', 'path' => '/', 'site_id' => self::$network_ids['www.wordpress.net/'] ), 32 31 'foo.wordpress.net/' => array( 'domain' => 'foo.wordpress.net', 'path' => '/', 'site_id' => self::$network_ids['www.wordpress.net/'] ), 33 32 'www.wordpress.net/foo/' => array( 'domain' => 'www.wordpress.net', 'path' => '/foo/', 'site_id' => self::$network_ids['www.wordpress.net/'] ), … … 37 36 $id = $factory->blog->create( $id ); 38 37 } 39 38 unset( $id ); 39 40 40 } 41 41 42 42 public static function wpTearDownAfterClass() { … … 170 170 'www.wordpress.net/', 171 171 ), 172 172 array( 173 'w ww.wordpress.org/',174 'w ww.wordpress.org/',173 'wordpress.org/', 174 'wordpress.org/', 175 175 ), 176 176 ); 177 177 }