1
0
Fork 0

Also trim trailing slashes in PathRepo, refs #5164

pull/5177/head
Jordi Boggiano 2016-04-11 13:11:46 +01:00
parent b981c1e09d
commit ad5951218b
2 changed files with 2 additions and 2 deletions

View File

@ -164,7 +164,7 @@ class PathRepository extends ArrayRepository implements ConfigurableRepositoryIn
{
// Ensure environment-specific path separators are normalized to URL separators
return array_map(function ($val) {
return str_replace(DIRECTORY_SEPARATOR, '/', $val);
return rtrim(str_replace(DIRECTORY_SEPARATOR, '/', $val), '/');
}, glob($this->url, GLOB_MARK | GLOB_ONLYDIR));
}
}

View File

@ -108,6 +108,6 @@ class PathRepositoryTest extends TestCase
// Convert platform specific separators back to generic URL slashes
$relativeUrl = str_replace(DIRECTORY_SEPARATOR, '/', $relativeUrl);
$this->assertEquals(rtrim($relativeUrl, '/'), rtrim($package->getDistUrl(), '/'));
$this->assertEquals($relativeUrl, $package->getDistUrl());
}
}