public static function get_cache_busted_file_url($file) { if ($ext = pathinfo($file, PATHINFO_EXTENSION)) { if ($ext == 'js' || $ext == 'css') { $myExt = strstr($file, 'combined.' . $ext) ? 'combined.' . $ext : $ext; $filePath = preg_replace('/\\?.*/', '', Director::baseFolder() . '/' . $file); $mTime = Requirements::get_suffix_requirements() ? "." . filemtime($filePath) : ''; $suffix = ''; if (strpos($file, '?') !== false) { $suffix = substr($file, strpos($file, '?')); } return str_replace('.' . $myExt, '', $file) . "{$mTime}.{$myExt}{$suffix}"; } } return false; }