From 750dfb60dce26dac570efb3d7460f1905444dba4 Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Thu, 30 Apr 2015 22:51:39 -0600 Subject: [PATCH] Fix to properly normalize the font rewrite path --- system/src/Grav/Common/Assets.php | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/system/src/Grav/Common/Assets.php b/system/src/Grav/Common/Assets.php index a2a741239..2d44912a8 100644 --- a/system/src/Grav/Common/Assets.php +++ b/system/src/Grav/Common/Assets.php @@ -881,18 +881,7 @@ class Assets return $matches[0]; } - $newpath = array(); - $paths = explode('/', $old_url); - - foreach ($paths as $path) { - if ($path == '..') { - $relative_path = dirname($relative_path); - } else { - $newpath[] = $path; - } - } - - $new_url = rtrim($this->base_url, '/') . $relative_path . '/' . implode('/', $newpath); + $new_url = $this->base_url . ltrim(Utils::normalizePath($relative_path . '/' . $old_url), '/'); return str_replace($old_url, $new_url, $matches[0]); },