Fix Folder::getRelativePath() so that it works with backslashes

This commit is contained in:
Matias Griese
2015-04-08 21:37:19 +03:00
parent 01899676a4
commit f0472fdd76

View File

@@ -72,8 +72,8 @@ abstract class Folder
public static function getRelativePath($path, $base = GRAV_ROOT)
{
if ($base) {
$base = preg_replace('![\\|/]+!', '/', $base);
$path = preg_replace('![\\|/]+!', '/', $path);
$base = preg_replace('![\\\/]+!', '/', $base);
$path = preg_replace('![\\\/]+!', '/', $path);
if (strpos($path, $base) === 0) {
$path = ltrim(substr($path, strlen($base)), '/');
}