From e9df3103641463efd9c615ed73164f3897f43bdf Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Sat, 1 Oct 2016 23:32:59 +0900 Subject: [PATCH] Additional fixes for #601 --- classes/frontendfile/FrontEndFileHandler.class.php | 11 ++++++++--- modules/editor/editor.admin.view.php | 5 +++++ modules/editor/tpl/admin_index.html | 1 - 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/classes/frontendfile/FrontEndFileHandler.class.php b/classes/frontendfile/FrontEndFileHandler.class.php index c06220a9d..70598ec4a 100644 --- a/classes/frontendfile/FrontEndFileHandler.class.php +++ b/classes/frontendfile/FrontEndFileHandler.class.php @@ -92,7 +92,7 @@ class FrontEndFileHandler extends Handler if(!is_array($args)) { $args = array($args); - } + } $args[0] = preg_replace(array_keys(HTMLDisplayHandler::$replacements), array_values(HTMLDisplayHandler::$replacements), $args[0]); $isCommon = preg_match(HTMLDisplayHandler::$reservedCSS, $args[0]) || preg_match(HTMLDisplayHandler::$reservedJS, $args[0]); if($args[3] > -1500000 && $isCommon) @@ -155,7 +155,8 @@ class FrontEndFileHandler extends Handler return $existsInfo[$existsKey]; } - $pathInfo = pathinfo($fileName); + $pathInfo = pathinfo($fileName); + $file = new stdClass(); $file->fileName = $pathInfo['basename']; $file->filePath = $this->_getAbsFileUrl($pathInfo['dirname']); @@ -172,7 +173,11 @@ class FrontEndFileHandler extends Handler $file->fileNameNoExt = $pathInfo['filename']; $file->isMinified = false; } - $file->isExternalURL = preg_match('@^(https?:)?//@i', $file->filePath) ? true : false; + $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->isCachedScript = !$file->isExternalURL && strpos($file->filePath, 'files/cache/') !== false; $file->isCommon = $isCommon; $file->keyName = $file->fileNameNoExt . '.' . $file->fileExtension; diff --git a/modules/editor/editor.admin.view.php b/modules/editor/editor.admin.view.php index 83cdeb99e..7a23d1878 100644 --- a/modules/editor/editor.admin.view.php +++ b/modules/editor/editor.admin.view.php @@ -132,6 +132,11 @@ class editorAdminView extends editor Context::set('component_list', $component_list); Context::set('component_count', $component_count); Context::set('editor_config_default', $editor_config_default); + + foreach ($config->additional_css as $additional_css_url) + { + Context::loadFile(array($additional_css_url)); + } $security = new Security(); $security->encodeHTML('component_list....'); diff --git a/modules/editor/tpl/admin_index.html b/modules/editor/tpl/admin_index.html index 367f1c051..e06ba1b38 100644 --- a/modules/editor/tpl/admin_index.html +++ b/modules/editor/tpl/admin_index.html @@ -116,7 +116,6 @@
- {@ var_dump($editor_config)}

{$lang->about_additional_css}