#64 서버 내 경로를 절대경로로 변경

This commit is contained in:
bnu 2013-11-22 14:57:24 +09:00
parent bf0dd35f0a
commit 932862be1f
42 changed files with 807 additions and 133 deletions

View file

@ -694,12 +694,13 @@ class Context
function getFTPInfo()
{
is_a($this, 'Context') ? $self = $this : $self = self::getInstance();
if(!$self->isFTPRegisted())
{
return null;
}
@include($self->getFTPConfigFile());
include($self->getFTPConfigFile());
return $ftp_info;
}

View file

@ -76,12 +76,13 @@ class DisplayHandler extends Handler
$called_position = 'before_display_content';
$oAddonController = &getController('addon');
$addon_file = $oAddonController->getCacheFilePath(Mobile::isFromMobilePhone() ? "mobile" : "pc");
@include($addon_file);
if(file_exists($addon_file)) include($addon_file);
if(method_exists($handler, "prepareToPrint"))
{
$handler->prepareToPrint($output);
}
// header output
if($this->gz_enabled)
{

View file

@ -100,7 +100,7 @@ class HTMLDisplayHandler
// search if the changes CSS exists in the admin layout edit window
$edited_layout_css = $oLayoutModel->getUserLayoutCss($layout_srl);
if(file_exists($edited_layout_css))
if(FileHandler::exists($edited_layout_css))
{
Context::loadFile(array($edited_layout_css, 'all', '', 100));
}
@ -278,7 +278,7 @@ class HTMLDisplayHandler
case 'number':
case 'range':
case 'color':
$str = preg_replace('@\svalue="[^"]*?"@', ' ', $str) . ' value="' . @htmlspecialchars($INPUT_ERROR[$match[3]], ENT_COMPAT | ENT_HTML401, 'UTF-8', false) . '"';
$str = preg_replace('@\svalue="[^"]*?"@', ' ', $str) . ' value="' . htmlspecialchars($INPUT_ERROR[$match[3]], ENT_COMPAT | ENT_HTML401, 'UTF-8', false) . '"';
break;
case 'password':
$str = preg_replace('@\svalue="[^"]*?"@', ' ', $str);

View file

@ -17,10 +17,11 @@ class FileHandler
*/
function getRealPath($source)
{
if(substr_compare($source, './', 0, 2) === 0)
if(strlen($source) > 2 && substr_compare($source, './', 0, 2) === 0)
{
return _XE_PATH_ . substr($source, 2);
}
return $source;
}

View file

@ -93,7 +93,7 @@ class ModuleHandler extends Handler
$called_position = 'before_module_init';
$oAddonController = getController('addon');
$addon_file = $oAddonController->getCacheFilePath(Mobile::isFromMobilePhone() ? 'mobile' : 'pc');
@include($addon_file);
if(file_exists($addon_file)) include($addon_file);
}
/**
@ -878,9 +878,9 @@ class ModuleHandler extends Handler
$oMenuAdminController = getAdminController('menu');
$homeMenuCacheFile = $oMenuAdminController->getHomeMenuCacheFile();
if(file_exists($homeMenuCacheFile))
if(FileHandler::exists($homeMenuCacheFile))
{
@include($homeMenuCacheFile);
include($homeMenuCacheFile);
}
if(!$menu->menu_srl)
@ -895,9 +895,11 @@ class ModuleHandler extends Handler
$menu->php_file = str_replace($menu->menu_srl, $homeMenuSrl, $menu->php_file);
}
}
if(file_exists($menu->php_file))
$php_file = FileHandler::exists($menu->php_file);
if($php_file)
{
@include($menu->php_file);
include($php_file);
}
Context::set($menu_id, $menu);
}

View file

@ -391,7 +391,7 @@ class ModuleObject extends Object
$called_position = 'before_module_proc';
$oAddonController = getController('addon');
$addon_file = $oAddonController->getCacheFilePath(Mobile::isFromMobilePhone() ? "mobile" : "pc");
@include($addon_file);
if(FileHandler::exists($addon_file)) include($addon_file);
if(isset($this->xml_info->action->{$this->act}) && method_exists($this, $this->act))
{
@ -450,7 +450,7 @@ class ModuleObject extends Object
$called_position = 'after_module_proc';
$oAddonController = getController('addon');
$addon_file = $oAddonController->getCacheFilePath(Mobile::isFromMobilePhone() ? "mobile" : "pc");
@include($addon_file);
if(FileHandler::exists($addon_file)) include($addon_file);
if(is_a($output, 'Object') || is_subclass_of($output, 'Object'))
{

View file

@ -17,8 +17,8 @@ class EmbedFilter
* @var int
*/
var $allowscriptaccessKey = 0;
var $whiteUrlXmlFile = './classes/security/conf/embedWhiteUrl.xml';
var $whiteUrlCacheFile = './files/cache/embedfilter/embedWhiteUrl.php';
var $whiteUrlXmlFile = _XE_PATH_ . 'classes/security/conf/embedWhiteUrl.xml';
var $whiteUrlCacheFile = _XE_PATH_ . 'files/cache/embedfilter/embedWhiteUrl.php';
var $whiteUrlList = array();
var $whiteIframeUrlList = array();
var $parser = NULL;

View file

@ -3,24 +3,23 @@
class UploadFileFilter
{
private static $_block_list = array ('exec', 'system', 'passthru', 'show_source', 'phpinfo', 'fopen', 'file_get_contents', 'file_put_contents', 'fwrite', 'proc_open', 'popen');
public function check($file)
{
// TODO: 기능개선후 enable
return TRUE; // disable
if (! $file || ! file_exists ( $file )) return TRUE;
if (! $file || ! FileHandler::exists($file)) return TRUE;
return self::_check ( $file );
}
private function _check($file)
{
if (! ($fp = fopen ( $file, 'r' ))) return FALSE;
$has_php_tag = FALSE;
while ( ! feof ( $fp ) )
{
$content = fread ( $fp, 8192 );
@ -34,9 +33,9 @@ class UploadFileFilter
}
}
}
fclose ( $fp );
return TRUE;
}
}

View file

@ -12,7 +12,7 @@
class TemplateHandler
{
private $compiled_path = './files/cache/template_compiled/'; ///< path of compiled caches files
private $compiled_path = 'files/cache/template_compiled/'; ///< path of compiled caches files
private $path = NULL; ///< target directory
private $filename = NULL; ///< target filename
private $file = NULL; ///< target file (fullpath)
@ -30,6 +30,7 @@ class TemplateHandler
public function __construct()
{
$this->xe_path = rtrim(preg_replace('/([^\.^\/]+)\.php$/i', '', $_SERVER['SCRIPT_NAME']), '/');
$this->compiled_path = _XE_PATH_ . $this->compiled_path;
}
/**

View file

@ -95,7 +95,7 @@ class Validator
));
$this->_has_mb_func = is_callable('mb_strlen');
$this->setCacheDir('./files/cache');
$this->setCacheDir(_XE_PATH_ . 'files/cache');
}
/**