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