merge sandbox to trunk for 1.4.4.1

git-svn-id: http://xe-core.googlecode.com/svn/trunk@7743 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
ngleader 2010-09-30 08:12:09 +00:00
parent b8299c8a65
commit 9139515e57
23 changed files with 93 additions and 38 deletions

View file

@ -1550,7 +1550,7 @@
} }
$path = '/'.implode('/', $_path); $path = '/'.implode('/', $_path);
if(substr($path,-1)!='/') $path .= '/';
return $path; return $path;
} }
} }

View file

@ -34,7 +34,7 @@ class Mobile {
} }
else if($_COOKIE["mobile"]) $this->ismobile = true; else if($_COOKIE["mobile"]) $this->ismobile = true;
else { 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); setcookie("mobile", true);
$this->ismobile = true; $this->ismobile = true;

View file

@ -44,7 +44,7 @@
function init($tpl_path, $tpl_filename, $tpl_file) { function init($tpl_path, $tpl_filename, $tpl_file) {
// verify arguments // verify arguments
if(substr($tpl_path,-1)!='/') $tpl_path .= '/'; 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 // create tpl_file variable
if(!$tpl_file) $tpl_file = $tpl_path.$tpl_filename; if(!$tpl_file) $tpl_file = $tpl_path.$tpl_filename;
@ -131,7 +131,8 @@
exit(); exit();
} }
return $this->parse(); $this->parse();
return $this->buff;
} }
/** /**
@ -226,7 +227,7 @@
* @param[in] $matches match * @param[in] $matches match
* @return changed result * @return changed result
**/ **/
private function _replacePath($matches) function _replacePath($matches)
{ {
$path = trim($matches[3]); $path = trim($matches[3]);
@ -400,7 +401,10 @@
**/ **/
function _replaceInclude($matches) 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]; $target = $m[1];
if(substr($target,0,1)=='/') if(substr($target,0,1)=='/')
@ -513,7 +517,7 @@
/** /**
* @brief $문자 PHP 변수 변환 * @brief $문자 PHP 변수 변환
**/ **/
private function _replaceVarInPHP($buff) { function _replaceVarInPHP($buff) {
$head = $tail = ''; $head = $tail = '';
while(false !== $pos = strpos($buff, '<?php')) while(false !== $pos = strpos($buff, '<?php'))
{ {
@ -521,7 +525,7 @@
$buff = substr($buff,$pos); $buff = substr($buff,$pos);
$pos = strpos($buff,'?>'); $pos = strpos($buff,'?>');
$body = substr($buff,0,$pos+2); $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); $buff = substr($buff,$pos+2);
} }
@ -532,7 +536,7 @@
/** /**
* @brief php5의 class::$변수명의 경우 context를 사용하지 않아야 하기에 함수로 대체 * @brief php5의 class::$변수명의 경우 context를 사용하지 않아야 하기에 함수로 대체
**/ **/
private function _replaceVarString($matches) function _replaceVarString($matches)
{ {
if($matches[1]==':') return $matches[0]; if($matches[1]==':') return $matches[0];
if(substr($matches[2],0,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); if(substr($arg,0,2)=='./') $arg = substr($arg,2);
// step1: check files in the template directory // 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 // step2: check path from root
if(!file_exists($source_filename)) $source_filename = './'.$arg; if(!file_exists($source_filename)) $source_filename = './'.$arg;

View file

@ -135,7 +135,9 @@ function printFileList($list){
header("ETag: \"". md5(join(' ', $list)) .'-'. dechex($mtime) .'-'.dechex($size)."\""); 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"); if($content_encoding) header("Content-Encoding: gzip");

View file

@ -13,7 +13,7 @@
* @brief XE의 전체 버전 표기 * @brief XE의 전체 버전 표기
* 파일의 수정이 없더라도 공식 릴리즈시에 수정되어 함께 배포되어야 * 파일의 수정이 없더라도 공식 릴리즈시에 수정되어 함께 배포되어야
**/ **/
define('__ZBXE_VERSION__', '1.4.4'); define('__ZBXE_VERSION__', '1.4.4.1');
/** /**
* @brief zbXE가 설치된 장소의 base path를 구함 * @brief zbXE가 설치된 장소의 base path를 구함

View file

@ -705,16 +705,21 @@
**/ **/
function fixQuotation($matches) { function fixQuotation($matches) {
$key = $matches[1]; $key = $matches[1];
$val = $matches[2]; $val = trim($matches[2]);
if(substr($val,0,1)!='"'){ $close_tag = false;
if(substr($val,-1)=='/'){ if(substr($val,-1)=='/') {
$val = '"'.substr($val,0,-1).'" /'; $close_tag = true;
}else{ $val = rtrim(substr($val,0,-1));
$val = '"'.$val.'"';
} }
if($val{0}=="'" && substr($val,-1)=="'")
{
$val = sprintf('"%s"', substr($val,1,-1));
} }
if($close_tag) $val .= ' /';
// attribute on* remove // 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 ''; 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 '';

View file

@ -2,13 +2,20 @@
/********************************************************************* /*********************************************************************
* *
* PHP FTP Client Class By TOMO ( groove@spencernetwork.org ) * PHP FTP Client Class By TOMO ( groove@spencernetwork.org )
* Modified By NHN ( developers@xpressengine.com )
*
* - Version 0.13 (2010/09/29)
* *
* - Version 0.12 (2002/01/11)
* - This script is free but without any warranty. * - This script is free but without any warranty.
* - You can freely copy, use, modify or redistribute this script * - You can freely copy, use, modify or redistribute this script
* for any purpose. * for any purpose.
* - But please do not erase this information!!. * - 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 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) function ftp_size($pathname)
@ -115,7 +122,7 @@
return -1; 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) function ftp_mdtm($pathname)
@ -125,7 +132,7 @@
$this->ftp_debug("Error : MDTM command failed\n"); $this->ftp_debug("Error : MDTM command failed\n");
return -1; 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"); $date = sscanf($mdtm, "%4d%2d%2d%2d%2d%2d");
$timestamp = mktime($date[3], $date[4], $date[5], $date[1], $date[2], $date[0]); $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"); $this->ftp_debug("Connected to remote host\n");
$list = array();
while (!feof($sock_data)) { 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_close_data_connection($sock_data);
$this->ftp_debug(implode("\n", $list)); $this->ftp_debug(implode("\n", $list));
@ -282,7 +290,7 @@
$this->ftp_debug("Connected to remote host\n"); $this->ftp_debug("Connected to remote host\n");
while (!feof($sock_data)) { 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_debug(implode("\n", $list));
$this->ftp_close_data_connection($sock_data); $this->ftp_close_data_connection($sock_data);
@ -450,7 +458,7 @@
return FALSE; 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; return $ip_port;
} }
@ -476,7 +484,7 @@
$this->ftp_debug(str_replace("\r\n", "\n", $this->ftp_resp)); $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; return FALSE;
} }
@ -491,7 +499,7 @@
function ftp_open_data_connection($ip_port) 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"); $this->ftp_debug("Error : Illegal ip-port format(".$ip_port.")\n");
return FALSE; return FALSE;
} }

View file

@ -46,12 +46,19 @@
{ {
return new Object(-1, 'msg_ftp_invalid_auth_info'); return new Object(-1, 'msg_ftp_invalid_auth_info');
} }
$this->pwd = $ftp_info->ftp_root_path; $this->pwd = $ftp_info->ftp_root_path;
if(!$ftp_info->ftp_host) if(!$ftp_info->ftp_host)
{ {
$ftp_info->ftp_host = "127.0.0.1"; $ftp_info->ftp_host = "127.0.0.1";
} }
if (!$ftp_info->ftp_port)
{
$ftp_info->ftp_port = "21";
}
if($ftp_info->sftp == 'Y') if($ftp_info->sftp == 'Y')
{ {
return $this->getSFTPList(); return $this->getSFTPList();

View file

@ -28,4 +28,6 @@
'last_update' => 'Last update', 'last_update' => 'Last update',
'ipaddress' => 'IP Address', 'ipaddress' => 'IP Address',
); );
$lang->no_text_comment = 'No text in this comment.';
?> ?>

View file

@ -28,4 +28,6 @@
'last_update' => 'Ultima actualización', 'last_update' => 'Ultima actualización',
'ipaddress' => 'Dirección IP', 'ipaddress' => 'Dirección IP',
); );
$lang->no_text_comment = 'No text in this comment.';
?> ?>

View file

@ -29,4 +29,6 @@
'last_update' => 'Mise à Jour', 'last_update' => 'Mise à Jour',
'ipaddress' => 'Adresse IP', 'ipaddress' => 'Adresse IP',
); );
$lang->no_text_comment = 'No text in this comment.';
?> ?>

View file

@ -29,4 +29,6 @@
'last_update' => '最終更新日 ', 'last_update' => '最終更新日 ',
'ipaddress' => 'IPアドレス', 'ipaddress' => 'IPアドレス',
); );
$lang->no_text_comment = 'No text in this comment.';
?> ?>

View file

@ -29,4 +29,6 @@
'last_update' => '최근수정일 ', 'last_update' => '최근수정일 ',
'ipaddress' => 'IP 주소', 'ipaddress' => 'IP 주소',
); );
$lang->no_text_comment = '텍스트가 없는 댓글입니다.';
?> ?>

View file

@ -29,4 +29,6 @@
'last_update' => 'Дата последнего обновления', 'last_update' => 'Дата последнего обновления',
'ipaddress' => 'IP-адрес', 'ipaddress' => 'IP-адрес',
); );
$lang->no_text_comment = 'No text in this comment.';
?> ?>

View file

@ -30,4 +30,6 @@
'last_update' => 'Cập nhật lần cuối', 'last_update' => 'Cập nhật lần cuối',
'ipaddress' => 'IP', 'ipaddress' => 'IP',
); );
$lang->no_text_comment = 'No text in this comment.';
?> ?>

View file

@ -29,4 +29,6 @@
'last_update' => '最后更新 ', 'last_update' => '最后更新 ',
'ipaddress' => 'IP 地址', 'ipaddress' => 'IP 地址',
); );
$lang->no_text_comment = 'No text in this comment.';
?> ?>

View file

@ -29,4 +29,6 @@
'last_update' => '最後更新', 'last_update' => '最後更新',
'ipaddress' => 'IP位址', 'ipaddress' => 'IP位址',
); );
$lang->no_text_comment = 'No text in this comment.';
?> ?>

View file

@ -45,10 +45,11 @@
</thead> </thead>
<tbody> <tbody>
<!--@foreach($comment_list as $no => $val)--> <!--@foreach($comment_list as $no => $val)-->
{@ $comment = cut_str(trim(htmlspecialchars(strip_tags($val->content))), 200, '...')}
<tr> <tr>
<td class="number center">{$no}</td> <td class="number center">{$no}</td>
<td class="center"><input type="checkbox" name="cart" value="{$val->comment_srl}" /></td> <td class="center"><input type="checkbox" name="cart" value="{$val->comment_srl}" /></td>
<td class="left"><a href="{getUrl('','document_srl',$val->document_srl)}#comment_{$val->comment_srl}" onclick="window.open(this.href);return false;">{cut_str(htmlspecialchars(strip_tags($val->content)),200,'...')}</a></td> <td class="left"><a href="{getUrl('','document_srl',$val->document_srl)}#comment_{$val->comment_srl}" onclick="window.open(this.href);return false;"><!--@if(strlen($comment))-->{$comment}<!--@else--><em style="font-style:italic;">{$lang->no_text_comment}</em><!--@end--></a></td>
<td class="nowrap"><span class="member_{$val->member_srl}">{htmlspecialchars($val->nick_name)}</span></td> <td class="nowrap"><span class="member_{$val->member_srl}">{htmlspecialchars($val->nick_name)}</span></td>
<td class="date center nowrap">{(zdate($val->regdate,"Y-m-d\nH:i:s"))}</td> <td class="date center nowrap">{(zdate($val->regdate,"Y-m-d\nH:i:s"))}</td>
<td class="number left nowrap"><a href="{getUrl('search_target','ipaddress','search_keyword',$val->ipaddress)}">{$val->ipaddress}</a></td> <td class="number left nowrap"><a href="{getUrl('search_target','ipaddress','search_keyword',$val->ipaddress)}">{$val->ipaddress}</a></td>

View file

@ -94,5 +94,5 @@
); );
$lang->success_trashed = "Successfully moved to trashcan"; $lang->success_trashed = "Successfully moved to trashcan";
$lang->msg_not_selected_document = '선택된 문서가 없습니다.'; $lang->msg_not_selected_document = 'There is no selected article.';
?> ?>

View file

@ -138,7 +138,14 @@
$ftp_info->ftp_pasv = Context::get('ftp_pasv'); $ftp_info->ftp_pasv = Context::get('ftp_pasv');
if(!$ftp_info->ftp_pasv) $ftp_info->ftp_pasv = "N"; if(!$ftp_info->ftp_pasv) $ftp_info->ftp_pasv = "N";
$ftp_info->sftp = Context::get('sftp'); $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')) { if(ini_get('safe_mode')) {
$ftp_info->ftp_password = Context::get('ftp_password'); $ftp_info->ftp_password = Context::get('ftp_password');
} }

View file

@ -328,11 +328,12 @@
$str = sprintf($str, join(',',$arr)); $str = sprintf($str, join(',',$arr));
FileHandler::writeFile($cache_file, $str); FileHandler::writeFile($cache_file, $str);
}
if(file_exists($cache_file)) {
$GLOBALS['__MODULE_EXTEND__'] = include($cache_file); $GLOBALS['__MODULE_EXTEND__'] = include($cache_file);
} else { } else {
$GLOBALS['__MODULE_EXTEND__'] = array(); $GLOBALS['__MODULE_EXTEND__'] = array();
} }
} }

View file

@ -146,16 +146,16 @@
// 외부 또는 /, #, { 로 시작하는 경로라면 그냥 pass // 외부 또는 /, #, { 로 시작하는 경로라면 그냥 pass
// /=absolute path, #=hash in a page, {=Template syntax // /=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); $p = Context::pathToUrl($this->path);
return sprintf("%s%s%s%s",$matches[1],$matches[2],$p.$val,$matches[4]); return sprintf("%s%s%s%s",$matches[1],$matches[2],$p.$val,$matches[4]);
} }
if(substr($val,0,2)=='./') $val = substr($val,2); 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]); return sprintf("%s%s%s%s",$matches[1],$matches[2],$p.$val,$matches[4]);
} }

View file

@ -8,7 +8,7 @@
$lang->page = "Page"; $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->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_modify = "Modify";
$lang->cmd_page_create = '페이지 생성'; $lang->cmd_page_create = 'Create a Page';
$lang->page_caching_interval = "Caching Time"; $lang->page_caching_interval = "Caching Time";
$lang->about_page_caching_interval = "The unit is minute, and it displays temporary saved data for assigned time.<br />It is recommended to cache for proper time if a lot of resources are needed when displaying other servers' data or information.<br />A value of 0 will not cache."; $lang->about_page_caching_interval = "The unit is minute, and it displays temporary saved data for assigned time.<br />It is recommended to cache for proper time if a lot of resources are needed when displaying other servers' data or information.<br />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.'; $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.';