Index: phpunit/tests/ms.php
===================================================================
--- phpunit/tests/ms.php	(revision 25706)
+++ phpunit/tests/ms.php	(working copy)
@@ -595,6 +595,35 @@
 	}
 
 	/**
+	 * Check the path for a sub-directory site is correctly sanitised,
+	 * and has a trailing slash.
+	 *
+	 * @ticket 23865
+	 */
+	function test_update_blog_sanitises_subdirectory_path() {
+		global $test_action_counter;
+
+		$user_id = $this->factory->user->create( array( 'role' => 'administrator' ) );
+		$blog_id = $this->factory->blog->create( array( 'user_id' => $user_id, 'path' => '/test_blogpath', 'title' => 'Test Title' ) );
+		$this->assertInternalType( 'int', $blog_id );
+
+		$result = update_blog_details( $blog_id, array('domain' => 'example.com', 'path' => 'my_path') );
+
+		$blog = get_blog_details( $blog_id );
+		$this->assertEquals( '/my_path/', $blog->path );
+
+		$result = update_blog_details( $blog_id, array('domain' => 'example.com', 'path' => 'my_path//') );
+
+		$blog = get_blog_details( $blog_id );
+		$this->assertEquals( '/my_path/', $blog->path );
+
+		$result = update_blog_details( $blog_id, array('domain' => 'example.com', 'path' => '/my_path') );
+
+		$blog = get_blog_details( $blog_id );
+		$this->assertEquals( '/my_path/', $blog->path );
+	}
+
+	/**
 	 * Test fetching a blog that doesn't exist and again after it exists.
 	 *
 	 * @ticket 23405
