Fix TemplateParserV1 and FrontEndFileHandler not recognizing Google webfonts '.../css2?...' URL as CSS

This commit is contained in:
Kijin Sung 2024-01-10 13:09:01 +09:00
parent b591f023ef
commit e2cfa524d0
4 changed files with 30 additions and 2 deletions

View file

@ -209,7 +209,7 @@ class FrontEndFileHandler extends Handler
$file->isExternalURL = preg_match('@^(https?:)?//@i', $file->filePath) ? true : false;
if ($file->isExternalURL && !$file->fileExtension)
{
$file->fileExtension = preg_match('/[\.\/](css|js)\b/', $fileName, $matches) ? $matches[1] : null;
$file->fileExtension = preg_match('/[\.\/](css|js)[0-9]?\b/', $fileName, $matches) ? $matches[1] : null;
}
$file->isCachedScript = !$file->isExternalURL && strpos($file->filePath, 'files/cache/') !== false;
$file->isCommon = $isCommon;