Fix handling of external CSS/JS URLs with query strings

xpressengine/xe-core#2114
This commit is contained in:
Kijin Sung 2017-08-16 23:05:45 +09:00
parent 224410c857
commit 73c09ce876
2 changed files with 11 additions and 2 deletions

View file

@ -177,7 +177,11 @@ class FrontEndFileHandler extends Handler
$file->filePath = $this->_getAbsFileUrl($pathInfo['dirname']);
$file->fileRealPath = FileHandler::getRealPath($pathInfo['dirname']);
$file->fileFullPath = $file->fileRealPath . '/' . $pathInfo['basename'];
$file->fileExtension = strtolower($pathInfo['extension']);
$file->fileExtension = strtolower($pathInfo['extension']);
if (($pos = strpos($file->fileExtension, '?')) !== false)
{
$file->fileExtension = substr($file->fileExtension, 0, $pos);
}
if (preg_match('/^(.+)\.min$/', $pathInfo['filename'], $matches))
{
$file->fileNameNoExt = $matches[1];