diff --git a/application/libraries/Paths.php b/application/libraries/Paths.php index 15841feaf..3afaaccc7 100644 --- a/application/libraries/Paths.php +++ b/application/libraries/Paths.php @@ -34,11 +34,14 @@ class Paths } function cache_buster($filepath) { + // make sure $filepath starts with a slash + if (substr($filepath, 0, 1) !== '/') $filepath = '/' . $filepath; + $fullpath = $_SERVER['DOCUMENT_ROOT'] . $filepath; if (file_exists($fullpath)) { return base_url($filepath) . '?v=' . filemtime($fullpath); } else { - log_message('error', 'CACHE BUSTER - File does not exist: ' . $filepath); + log_message('error', 'CACHE BUSTER: File does not exist: ' . $fullpath); } return base_url($filepath); }