Additional fixes for #601

This commit is contained in:
Kijin Sung 2016-10-01 23:32:59 +09:00
parent f8fb61ec6c
commit e9df310364
3 changed files with 13 additions and 4 deletions

View file

@ -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;

View file

@ -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....');

View file

@ -116,7 +116,6 @@
<div class="x_control-group">
<label class="x_control-label">{$lang->guide_additional_css}</label>
<div class="x_controls">
{@ var_dump($editor_config)}
<textarea id="additional_css" name="additional_css" style="width:90%" rows="4" cols="42">{escape(implode("\n", $editor_config->additional_css ?: array()))}</textarea>
<p class="x_help-block">{$lang->about_additional_css}</p>
</div>