mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 14:20:15 +00:00
Use a less complex approach for enforcing path slashes in update_blog_details()
Ensure leading and traling slashes are in place and don't touch anything in the middle. Validating with `array_filter()` would have missed a possible valid falsy path - `/my-path/0/`. Props nacin. Fixes #18117. git-svn-id: https://develop.svn.wordpress.org/trunk@31158 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -591,10 +591,14 @@ class Tests_Multisite_Site extends WP_UnitTestCase {
|
||||
$this->assertEquals( '/multiple/dirs/', $blog->path );
|
||||
}
|
||||
|
||||
/**
|
||||
* `update_blog_details()` does not resolve multiple slashes in the
|
||||
* middle of a path string.
|
||||
*/
|
||||
function test_update_blog_details_multiple_paths_middle_slashes() {
|
||||
update_blog_details( 1, array( 'path' => 'multiple///dirs' ) );
|
||||
$blog = get_blog_details( 1 );
|
||||
$this->assertEquals( '/multiple/dirs/', $blog->path );
|
||||
$this->assertEquals( '/multiple///dirs/', $blog->path );
|
||||
}
|
||||
|
||||
function test_update_blog_details_multiple_paths_leading_slash() {
|
||||
|
||||
Reference in New Issue
Block a user