From 5a873ec0c680f739633f7e2b372e76421c26275c Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Tue, 25 Mar 2014 17:32:16 +0000 Subject: [PATCH] Ensure the $path is trailing-slashed in domain_exists(). props ejdanderson, ericmann. fixes #18209. Built from https://develop.svn.wordpress.org/trunk@27717 git-svn-id: http://core.svn.wordpress.org/trunk@27556 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/ms-functions.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/wp-includes/ms-functions.php b/wp-includes/ms-functions.php index 2e26cbf9cb..8784623d05 100644 --- a/wp-includes/ms-functions.php +++ b/wp-includes/ms-functions.php @@ -1299,7 +1299,9 @@ Disable these notifications: %3$s'), $user->user_login, wp_unslash( $_SERVER['RE */ function domain_exists($domain, $path, $site_id = 1) { global $wpdb; + $path = trailingslashit( $path ); $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) ); + /** * Filter whether a blogname is taken. *