mirror of
https://github.com/getgrav/grav.git
synced 2026-05-09 00:37:13 +02:00
Fix Folder::getRelativePath() so that it works with backslashes
This commit is contained in:
@@ -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)), '/');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user