Ticket #20589: 20589.2.diff
File 20589.2.diff, 1.4 KB (added by , 11 years ago) |
---|
-
src/wp-includes/ms-functions.php
1289 1289 */ 1290 1290 function domain_exists($domain, $path, $site_id = 1) { 1291 1291 global $wpdb; 1292 1293 $path = trailingslashit( $path ); 1294 1292 1295 $result = $wpdb->get_var( $wpdb->prepare("SELECT blog_id FROM $wpdb->blogs WHERE domain = %s AND path = %s AND site_id = %d", $domain, $path, $site_id) ); 1293 1296 /** 1294 1297 * Filter whether a blogname is taken. -
tests/phpunit/tests/ms.php
962 962 } 963 963 964 964 function _domain_exists_cb( $exists, $domain, $path, $site_id ) { 965 if ( 'foo' == $domain && 'bar ' == $path )965 if ( 'foo' == $domain && 'bar/' == $path ) 966 966 return 1234; 967 967 else 968 968 return null; … … 984 984 $this->assertEquals( null, domain_exists( 'foo', 'baz' ) ); 985 985 $this->assertEquals( null, domain_exists( 'bar', 'foo' ) ); 986 986 987 // Make sure the same result is returned with or without a trailing slash 988 $this->assertEquals( domain_exists( 'foo', 'bar' ), domain_exists( 'foo', 'bar/' ) ); 989 987 990 remove_filter( 'domain_exists', array( $this, '_domain_exists_cb' ), 10, 4 ); 988 991 $this->assertEquals( null, domain_exists( 'foo', 'bar' ) ); 989 992