diff --git a/classes/context/Context.class.php b/classes/context/Context.class.php index c63dbb661..70ec569c1 100644 --- a/classes/context/Context.class.php +++ b/classes/context/Context.class.php @@ -1550,7 +1550,7 @@ } $path = '/'.implode('/', $_path); - + if(substr($path,-1)!='/') $path .= '/'; return $path; } } diff --git a/classes/mobile/Mobile.class.php b/classes/mobile/Mobile.class.php index 07968047d..eef9d43e7 100644 --- a/classes/mobile/Mobile.class.php +++ b/classes/mobile/Mobile.class.php @@ -34,7 +34,7 @@ class Mobile { } else if($_COOKIE["mobile"]) $this->ismobile = true; else { - if(preg_match('/(iPod|iPhone|Android|BlackBerry|SCH\-M[0-9]+)/',$_SERVER['HTTP_USER_AGENT'])) + if(preg_match('/(iPod|iPhone|Android|BlackBerry|SymbianOS|SCH\-M[0-9]+)/',$_SERVER['HTTP_USER_AGENT'])) { setcookie("mobile", true); $this->ismobile = true; diff --git a/classes/template/TemplateHandler.class.php b/classes/template/TemplateHandler.class.php index 92288dce4..df202e76b 100644 --- a/classes/template/TemplateHandler.class.php +++ b/classes/template/TemplateHandler.class.php @@ -44,7 +44,7 @@ function init($tpl_path, $tpl_filename, $tpl_file) { // verify arguments if(substr($tpl_path,-1)!='/') $tpl_path .= '/'; - if(substr($tpl_filename,-5)!='.html') $tpl_filename .= '.html'; + if(!file_exists($tpl_path.$tpl_filename)&&file_exists($tpl_path.$tpl_filename.'.html')) $tpl_filename .= '.html'; // create tpl_file variable if(!$tpl_file) $tpl_file = $tpl_path.$tpl_filename; @@ -131,7 +131,8 @@ exit(); } - return $this->parse(); + $this->parse(); + return $this->buff; } /** @@ -226,7 +227,7 @@ * @param[in] $matches match * @return changed result **/ - private function _replacePath($matches) + function _replacePath($matches) { $path = trim($matches[3]); @@ -400,7 +401,10 @@ **/ function _replaceInclude($matches) { - if(!preg_match('/target=\"([^\"]+)\"/is',$matches[0], $m)) throw new Exception('"target" attribute missing in "'.htmlspecialchars($matches[0]).'"'); + if(!preg_match('/target=\"([^\"]+)\"/is',$matches[0], $m)) { + print '"target" attribute missing in "'.htmlspecialchars($matches[0]); + exit(); + } $target = $m[1]; if(substr($target,0,1)=='/') @@ -513,7 +517,7 @@ /** * @brief $문자 의 PHP 변수 변환 **/ - private function _replaceVarInPHP($buff) { + function _replaceVarInPHP($buff) { $head = $tail = ''; while(false !== $pos = strpos($buff, ''); $body = substr($buff,0,$pos+2); - $head .= preg_replace_callback('/(.?)\$([a-z0-9\_\-\[\]\'\"]+)/is',array($this, '_replaceVarString'), $body); + $head .= preg_replace_callback('/(.?)\$(\w+[a-z0-9\_\-\[\]\'\"]+)/is',array($this, '_replaceVarString'), $body); $buff = substr($buff,$pos+2); } @@ -532,7 +536,7 @@ /** * @brief php5의 class::$변수명의 경우 context를 사용하지 않아야 하기에 함수로 대체 **/ - private function _replaceVarString($matches) + function _replaceVarString($matches) { if($matches[1]==':') return $matches[0]; if(substr($matches[2],0,1)=='_') return $matches[0]; @@ -566,7 +570,9 @@ if(substr($arg,0,2)=='./') $arg = substr($arg,2); // step1: check files in the template directory - $source_filename = sprintf("%s/%s", dirname($this->file), $arg); + //$source_filename = sprintf("%s/%s", dirname($this->file), $arg); + $path = substr($this->path,-1)=='/'?substr($this->path,0,-1):$this->path; + $source_filename = sprintf("%s/%s", $path, $arg); // step2: check path from root if(!file_exists($source_filename)) $source_filename = './'.$arg; diff --git a/common/script.php b/common/script.php index a6e8b7251..b27c7977b 100644 --- a/common/script.php +++ b/common/script.php @@ -135,7 +135,9 @@ function printFileList($list){ header("ETag: \"". md5(join(' ', $list)) .'-'. dechex($mtime) .'-'.dechex($size)."\""); } - header("Content-Length: ". $size); + // Fix : 서버에서 gzip 압축을 제공하는 경우 콘텐츠의 길이가 실제와 일치하지 않아 문제가 발생하여 + // Content-Length 헤더를 생략함. Core #19159958 이슈 참고. + // header("Content-Length: ". $size); if($content_encoding) header("Content-Encoding: gzip"); diff --git a/config/config.inc.php b/config/config.inc.php index 2aca1ba3d..84fe3f640 100644 --- a/config/config.inc.php +++ b/config/config.inc.php @@ -13,7 +13,7 @@ * @brief XE의 전체 버전 표기 * 이 파일의 수정이 없더라도 공식 릴리즈시에 수정되어 함께 배포되어야 함 **/ - define('__ZBXE_VERSION__', '1.4.4'); + define('__ZBXE_VERSION__', '1.4.4.1'); /** * @brief zbXE가 설치된 장소의 base path를 구함 diff --git a/config/func.inc.php b/config/func.inc.php index 4a3ca6194..aca4c6120 100644 --- a/config/func.inc.php +++ b/config/func.inc.php @@ -705,15 +705,20 @@ **/ function fixQuotation($matches) { $key = $matches[1]; - $val = $matches[2]; + $val = trim($matches[2]); - if(substr($val,0,1)!='"'){ - if(substr($val,-1)=='/'){ - $val = '"'.substr($val,0,-1).'" /'; - }else{ - $val = '"'.$val.'"'; - } + $close_tag = false; + if(substr($val,-1)=='/') { + $close_tag = true; + $val = rtrim(substr($val,0,-1)); } + + if($val{0}=="'" && substr($val,-1)=="'") + { + $val = sprintf('"%s"', substr($val,1,-1)); + } + + if($close_tag) $val .= ' /'; // attribute on* remove if(preg_match('/^on(click|load|unload|blur|dbclick|focus|resize|keypress|keyup|keydown|mouseover|mouseout|mouseup|select|change|error)/',preg_replace('/[^a-zA-Z_]/','',$key))) return ''; diff --git a/libs/ftp.class.php b/libs/ftp.class.php index ad6c526cf..d49a2efbb 100644 --- a/libs/ftp.class.php +++ b/libs/ftp.class.php @@ -2,12 +2,19 @@ /********************************************************************* * * PHP FTP Client Class By TOMO ( groove@spencernetwork.org ) + * Modified By NHN ( developers@xpressengine.com ) * - * - Version 0.12 (2002/01/11) + * - Version 0.13 (2010/09/29) + * * - This script is free but without any warranty. * - You can freely copy, use, modify or redistribute this script * for any purpose. * - But please do not erase this information!!. + * + * Change log + * - Version 0.13 (2010/09/29) + * . use preg functions instead of ereg functions + * - Version 0.12 (2002/01/11) * ********************************************************************/ @@ -104,7 +111,7 @@ return FALSE; } - return ereg_replace("^[0-9]{3} \"(.+)\" .+\r\n", "\\1", $this->ftp_resp); + return preg_replace("@^[0-9]{3} \"(.+)\" .+\r\n@", "\\1", $this->ftp_resp); } function ftp_size($pathname) @@ -115,7 +122,7 @@ return -1; } - return ereg_replace("^[0-9]{3} ([0-9]+)\r\n", "\\1", $this->ftp_resp); + return preg_replace("@^[0-9]{3} ([0-9]+)\r\n@", "\\1", $this->ftp_resp); } function ftp_mdtm($pathname) @@ -125,7 +132,7 @@ $this->ftp_debug("Error : MDTM command failed\n"); return -1; } - $mdtm = ereg_replace("^[0-9]{3} ([0-9]+)\r\n", "\\1", $this->ftp_resp); + $mdtm = preg_replace("@^[0-9]{3} ([0-9]+)\r\n@", "\\1", $this->ftp_resp); $date = sscanf($mdtm, "%4d%2d%2d%2d%2d%2d"); $timestamp = mktime($date[3], $date[4], $date[5], $date[1], $date[2], $date[0]); @@ -250,8 +257,9 @@ } $this->ftp_debug("Connected to remote host\n"); + $list = array(); while (!feof($sock_data)) { - $list[] = ereg_replace("[\r\n]", "", fgets($sock_data, 512)); + $list[] = preg_replace("@[\r\n]@", "", fgets($sock_data, 512)); } $this->ftp_close_data_connection($sock_data); $this->ftp_debug(implode("\n", $list)); @@ -282,7 +290,7 @@ $this->ftp_debug("Connected to remote host\n"); while (!feof($sock_data)) { - $list[] = ereg_replace("[\r\n]", "", fgets($sock_data, 512)); + $list[] = preg_replace("@[\r\n]@", "", fgets($sock_data, 512)); } $this->ftp_debug(implode("\n", $list)); $this->ftp_close_data_connection($sock_data); @@ -450,7 +458,7 @@ return FALSE; } - $ip_port = ereg_replace("^.+ \\(?([0-9]{1,3},[0-9]{1,3},[0-9]{1,3},[0-9]{1,3},[0-9]+,[0-9]+)\\)?.*\r\n$", "\\1", $this->ftp_resp); + $ip_port = preg_replace("@^.+ \\(?([0-9]{1,3},[0-9]{1,3},[0-9]{1,3},[0-9]{1,3},[0-9]+,[0-9]+)\\)?.*\r\n$@", "\\1", $this->ftp_resp); return $ip_port; } @@ -476,7 +484,7 @@ $this->ftp_debug(str_replace("\r\n", "\n", $this->ftp_resp)); - if (!ereg("^[123]", $this->ftp_resp)) { + if (!preg_match("@^[123]@", $this->ftp_resp)) { return FALSE; } @@ -491,7 +499,7 @@ function ftp_open_data_connection($ip_port) { - if (!ereg("[0-9]{1,3},[0-9]{1,3},[0-9]{1,3},[0-9]{1,3},[0-9]+,[0-9]+", $ip_port)) { + if (!preg_match("@[0-9]{1,3},[0-9]{1,3},[0-9]{1,3},[0-9]{1,3},[0-9]+,[0-9]+@", $ip_port)) { $this->ftp_debug("Error : Illegal ip-port format(".$ip_port.")\n"); return FALSE; } diff --git a/modules/admin/admin.admin.model.php b/modules/admin/admin.admin.model.php index 9e502f638..501562271 100644 --- a/modules/admin/admin.admin.model.php +++ b/modules/admin/admin.admin.model.php @@ -46,12 +46,19 @@ { return new Object(-1, 'msg_ftp_invalid_auth_info'); } + $this->pwd = $ftp_info->ftp_root_path; + if(!$ftp_info->ftp_host) { $ftp_info->ftp_host = "127.0.0.1"; } + if (!$ftp_info->ftp_port) + { + $ftp_info->ftp_port = "21"; + } + if($ftp_info->sftp == 'Y') { return $this->getSFTPList(); diff --git a/modules/comment/lang/en.lang.php b/modules/comment/lang/en.lang.php index 8bc6908d1..c201816e2 100644 --- a/modules/comment/lang/en.lang.php +++ b/modules/comment/lang/en.lang.php @@ -28,4 +28,6 @@ 'last_update' => 'Last update', 'ipaddress' => 'IP Address', ); + + $lang->no_text_comment = 'No text in this comment.'; ?> diff --git a/modules/comment/lang/es.lang.php b/modules/comment/lang/es.lang.php index d1dfd720b..4240bb704 100644 --- a/modules/comment/lang/es.lang.php +++ b/modules/comment/lang/es.lang.php @@ -28,4 +28,6 @@ 'last_update' => 'Ultima actualización', 'ipaddress' => 'Dirección IP', ); + + $lang->no_text_comment = 'No text in this comment.'; ?> diff --git a/modules/comment/lang/fr.lang.php b/modules/comment/lang/fr.lang.php index aa9755333..39960e0be 100644 --- a/modules/comment/lang/fr.lang.php +++ b/modules/comment/lang/fr.lang.php @@ -29,4 +29,6 @@ 'last_update' => 'Mise à Jour', 'ipaddress' => 'Adresse IP', ); + + $lang->no_text_comment = 'No text in this comment.'; ?> diff --git a/modules/comment/lang/jp.lang.php b/modules/comment/lang/jp.lang.php index 3e31a87e1..05c55c038 100644 --- a/modules/comment/lang/jp.lang.php +++ b/modules/comment/lang/jp.lang.php @@ -29,4 +29,6 @@ 'last_update' => '最終更新日 ', 'ipaddress' => 'IPアドレス', ); + + $lang->no_text_comment = 'No text in this comment.'; ?> diff --git a/modules/comment/lang/ko.lang.php b/modules/comment/lang/ko.lang.php index 589336a4c..1c29e83c9 100644 --- a/modules/comment/lang/ko.lang.php +++ b/modules/comment/lang/ko.lang.php @@ -29,4 +29,6 @@ 'last_update' => '최근수정일 ', 'ipaddress' => 'IP 주소', ); + + $lang->no_text_comment = '텍스트가 없는 댓글입니다.'; ?> diff --git a/modules/comment/lang/ru.lang.php b/modules/comment/lang/ru.lang.php index c9151c3f3..331c41b70 100644 --- a/modules/comment/lang/ru.lang.php +++ b/modules/comment/lang/ru.lang.php @@ -29,4 +29,6 @@ 'last_update' => 'Дата последнего обновления', 'ipaddress' => 'IP-адрес', ); + + $lang->no_text_comment = 'No text in this comment.'; ?> diff --git a/modules/comment/lang/vi.lang.php b/modules/comment/lang/vi.lang.php index da0a75ca0..a8c2629b5 100644 --- a/modules/comment/lang/vi.lang.php +++ b/modules/comment/lang/vi.lang.php @@ -30,4 +30,6 @@ 'last_update' => 'Cập nhật lần cuối', 'ipaddress' => 'IP', ); + + $lang->no_text_comment = 'No text in this comment.'; ?> diff --git a/modules/comment/lang/zh-CN.lang.php b/modules/comment/lang/zh-CN.lang.php index b0790bcbd..b2cdf02ac 100644 --- a/modules/comment/lang/zh-CN.lang.php +++ b/modules/comment/lang/zh-CN.lang.php @@ -29,4 +29,6 @@ 'last_update' => '最后更新 ', 'ipaddress' => 'IP 地址', ); + + $lang->no_text_comment = 'No text in this comment.'; ?> diff --git a/modules/comment/lang/zh-TW.lang.php b/modules/comment/lang/zh-TW.lang.php index 370d6ca5a..0048e4675 100644 --- a/modules/comment/lang/zh-TW.lang.php +++ b/modules/comment/lang/zh-TW.lang.php @@ -29,4 +29,6 @@ 'last_update' => '最後更新', 'ipaddress' => 'IP位址', ); + + $lang->no_text_comment = 'No text in this comment.'; ?> diff --git a/modules/comment/tpl/comment_list.html b/modules/comment/tpl/comment_list.html index dfd9843b6..5a27b14f6 100644 --- a/modules/comment/tpl/comment_list.html +++ b/modules/comment/tpl/comment_list.html @@ -45,10 +45,11 @@ + {@ $comment = cut_str(trim(htmlspecialchars(strip_tags($val->content))), 200, '...')} {$no} - {cut_str(htmlspecialchars(strip_tags($val->content)),200,'...')} + {$comment}{$lang->no_text_comment} {htmlspecialchars($val->nick_name)} {(zdate($val->regdate,"Y-m-d\nH:i:s"))} {$val->ipaddress} diff --git a/modules/document/lang/en.lang.php b/modules/document/lang/en.lang.php index 7806d1b3f..bb17282eb 100644 --- a/modules/document/lang/en.lang.php +++ b/modules/document/lang/en.lang.php @@ -94,5 +94,5 @@ ); $lang->success_trashed = "Successfully moved to trashcan"; - $lang->msg_not_selected_document = 'õ ϴ.'; + $lang->msg_not_selected_document = 'There is no selected article.'; ?> diff --git a/modules/install/install.admin.controller.php b/modules/install/install.admin.controller.php index 6b5028a10..270290301 100644 --- a/modules/install/install.admin.controller.php +++ b/modules/install/install.admin.controller.php @@ -138,7 +138,14 @@ $ftp_info->ftp_pasv = Context::get('ftp_pasv'); if(!$ftp_info->ftp_pasv) $ftp_info->ftp_pasv = "N"; $ftp_info->sftp = Context::get('sftp'); - $ftp_info->ftp_root_path = Context::get('ftp_root_path'); + + $ftp_root_path = Context::get('ftp_root_path'); + if (substr($ftp_root_path, strlen($ftp_root_path)-1) == "/") { + $ftp_info->ftp_root_path = $ftp_root_path; + } else { + $ftp_info->ftp_root_path = $ftp_root_path.'/'; + } + if(ini_get('safe_mode')) { $ftp_info->ftp_password = Context::get('ftp_password'); } diff --git a/modules/module/module.model.php b/modules/module/module.model.php index 9f76c73b5..2dfbf258b 100644 --- a/modules/module/module.model.php +++ b/modules/module/module.model.php @@ -328,11 +328,12 @@ $str = sprintf($str, join(',',$arr)); FileHandler::writeFile($cache_file, $str); + } + + if(file_exists($cache_file)) { $GLOBALS['__MODULE_EXTEND__'] = include($cache_file); - } else { - $GLOBALS['__MODULE_EXTEND__'] = array(); } } diff --git a/modules/opage/opage.view.php b/modules/opage/opage.view.php index db544f3d0..71d6ee849 100644 --- a/modules/opage/opage.view.php +++ b/modules/opage/opage.view.php @@ -146,17 +146,17 @@ // 외부 또는 /, #, { 로 시작하는 경로라면 그냥 pass // /=absolute path, #=hash in a page, {=Template syntax - if(preg_match('@^((?:http|https|ftp|telnet|mms)://|(?:mailto|javascript):|[/#{])@i',$val)) return $matches[0]; + if(preg_match('@^((?:http|https|ftp|telnet|mms)://|(?:mailto|javascript):|[/#{])@i',$val)) { + return $matches[0]; // .. 와 같은 경우 대상 경로를 구함 - elseif(preg_match('/^\.\./i',$val)) { + } elseif(preg_match('/^\.\./i',$val)) { $p = Context::pathToUrl($this->path); return sprintf("%s%s%s%s",$matches[1],$matches[2],$p.$val,$matches[4]); } if(substr($val,0,2)=='./') $val = substr($val,2); - //$p = '/'.str_replace(_XE_PATH_,'',$this->path); - $p = Context::pathToUrl($this->path); + $p = Context::pathToUrl($this->path); return sprintf("%s%s%s%s",$matches[1],$matches[2],$p.$val,$matches[4]); } diff --git a/modules/page/lang/en.lang.php b/modules/page/lang/en.lang.php index 85564ab5e..1e4f396f5 100644 --- a/modules/page/lang/en.lang.php +++ b/modules/page/lang/en.lang.php @@ -8,7 +8,7 @@ $lang->page = "Page"; $lang->about_page = "It is a blog module which you can create a complete page.\nUsing latest or other widgets, you can create a dynamic page. Through the editor component, you can also create a great variety of pages.\nIts URL is same as other module's such as mid=module name.\n If it is selected as a default, it will be the main page of the site."; $lang->cmd_page_modify = "Modify"; - $lang->cmd_page_create = '페이지 생성'; + $lang->cmd_page_create = 'Create a Page'; $lang->page_caching_interval = "Caching Time"; $lang->about_page_caching_interval = "The unit is minute, and it displays temporary saved data for assigned time.
It is recommended to cache for proper time if a lot of resources are needed when displaying other servers' data or information.
A value of 0 will not cache."; $lang->about_mcontent = 'This is the page for the mobile view. If you do not write this page, the mobile view display reoragnized PC view\'s page.';