WordPress.org

Make WordPress Core


Ignore:
Timestamp:
01/12/2015 04:20:47 AM (5 years ago)
Author:
jeremyfelt
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/multisite/site.php

    r31157 r31158  
    592592    }
    593593
     594    /**
     595     * `update_blog_details()` does not resolve multiple slashes in the
     596     * middle of a path string.
     597     */
    594598    function test_update_blog_details_multiple_paths_middle_slashes() {
    595599        update_blog_details( 1, array( 'path' => 'multiple///dirs' ) );
    596600        $blog = get_blog_details( 1 );
    597         $this->assertEquals( '/multiple/dirs/', $blog->path );
     601        $this->assertEquals( '/multiple///dirs/', $blog->path );
    598602    }
    599603
Note: See TracChangeset for help on using the changeset viewer.