tag 1.4.1.1

git-svn-id: http://xe-core.googlecode.com/svn/trunk@7424 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
haneul 2010-05-06 05:42:15 +00:00
parent fd91cb9e30
commit 55e72e3b47
13 changed files with 59 additions and 40 deletions

View file

@ -1342,6 +1342,7 @@
static $loaded_plugins = array();
if($loaded_plugins[$plugin_name]) return;
$loaded_plugins[$plugin_name] = true;
if($plugin_name == "ui.datepicker") return $this->_loadJavascriptPlugin("ui");
$plugin_path = './common/js/plugins/'.$plugin_name.'/';
if(!is_dir($plugin_path)) return;

View file

@ -1 +0,0 @@
jquery.ui.datepicker-ko.js

View file

@ -1,2 +1,3 @@
jquery-ui.packed.js
jquery-ui.css
jquery.ui.datepicker-ko.js

View file

@ -289,7 +289,16 @@ $.exec_xml = window.exec_xml = function(module, act, params, callback_func, resp
success : onsuccess,
error : function(xhr, textStatus) {
waiting_obj.css('visibility', 'hidden');
alert(textStatus);
var msg = '';
if (textStatus == 'parsererror') {
msg = 'The result is not valid XML :\n-------------------------------------\n';
msg += xhr.responseText.replace(/<[^>]+>/g, '');
} else {
msg = textStatus;
}
alert(msg);
}
});
} catch(e) {

View file

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

View file

@ -622,10 +622,7 @@
**/
function removeHackTag($content) {
// 특정 태그들을 일반 문자로 변경
$content = preg_replace('/<(\/?)(iframe|script|meta|style|applet)/is', '&lt;$1$2', $content);
// XSS 사용을 위한 이벤트 제거
$content = preg_replace_callback("!<([a-z]+)(.*?)>!is", removeJSEvent, $content);
$content = preg_replace('/<(\/?)(iframe|script|meta|style|applet|link|base|html)/is', '&lt;$1$2', $content);
/**
* 이미지나 동영상등의 태그에서 src에 관리자 세션을 악용하는 코드를 제거
@ -636,32 +633,6 @@
return $content;
}
function removeJSEvent($matches) {
$attrs = $matches[2];
// vbscript|javascript 제거
if(preg_match('/(src|href|lowsrc|dynsrc)=("|\'?)([\r\n]*)(vbscript|javascript)/is', $matches[2])) {
$attrs = preg_replace('/(src|href|lowsrc|dynsrc)=("|\'?)([\r\n]*)(vbscript|javascript)/is','$1=$2_$4', $attrs);
}
if(preg_match('/(url)[ \n]*\(("|\'?)([\r\n]*)(vbscript|javascript)/is', $matches[2])) {
$attrs = preg_replace('/(url)[ \n]*\(("|\'?)([\r\n]*)(vbscript|javascript)/is','$1($2_$4', $attrs);
}
// 이벤트 제거
// 전제 : 1. 이벤트명 앞에는 개행(r, n, rn)문자와 공백 문자만 올 수 있음
// 2. 이벤트명 뒤에는 등호(=)가 존재해야하나 앞, 뒤에 공백이 있을 수 있음
// 3. 에디터 컴포넌트에서 on으로 시작하는 변수명을 가질 수 있으므로 실제 이벤트명만을 체크해야 함
$attrs = preg_replace(
'/(\r|\n| |\t|\"|\'|\/|\`)+on(click|dblclick|mousedown|mouseup|mouseover|mouseout|mousemove|keydown|keyup|keypress|load|unload|abort|error|select|change|submit|reset|resize|scroll|focus|blur|forminput|input|invaild|drag|dragend|dragenter|dragleave|dragover|dragstart|drop|mousewheel|scroll|canplay|canplaythrough|durationchange|emptied|ended|error|loadeddata|loadstart|pause|play|playing|progress|ratechange|readystatechange|seeked|seeking|stalled|suspend|timeupdate|volumechange|waiting|message|show)+([= \r\n\t]+)/is',
' _on$2=',
$attrs
);
// 링크를 새창으로 열기 위한 이벤트만 복구
$attrs = preg_replace('/_onclick=("|\')window\.open\(this\.href\);(.?)return false;("|\')/i','onclick=$1window.open(this.href);$2return false;$3', $attrs);
return '<'.$matches[1].$attrs.'>';
}
function removeSrcHack($matches) {
$tag = strtolower(trim($matches[1]));
@ -672,6 +643,7 @@
$oXmlParser = new XmlParser();
$xml_doc = $oXmlParser->parse($buff);
if(!$xml_doc) return sprintf("<%s>", $tag);
// src값에 module=admin이라는 값이 입력되어 있으면 이 값을 무효화 시킴
$src = $xml_doc->{$tag}->attrs->src;
@ -679,11 +651,29 @@
$lowsrc = $xml_doc->{$tag}->attrs->lowsrc;
$href = $xml_doc->{$tag}->attrs->href;
$data = $xml_doc->{$tag}->attrs->data;
if(_isHackedSrc($src) || _isHackedSrc($dynsrc) || _isHackedSrc($lowsrc) || _isHackedSrc($href) || _isHackedSrc($data)) return sprintf("<%s>",$tag);
$background = $xml_doc->{$tag}->attrs->background;
$style = $xml_doc->{$tag}->attrs->style;
if($style) {
$url = preg_match_all('/url\s*\(([^\)]+)\)/is', $style, $matches2);
if(count($matches2[0]))
{
foreach($matches2[1] as $target)
{
if(_isHackedSrc($target)) return sprintf("<%s>",$tag);
}
}
}
if(_isHackedSrc($src) || _isHackedSrc($dynsrc) || _isHackedSrc($lowsrc) || _isHackedSrc($href) || _isHackedSrc($data) || _isHackedSrc($background) || _isHackedSrcExp($style)) return sprintf("<%s>",$tag);
return $matches[0];
}
function _isHackedSrcExp($style) {
if(!$style) return false;
if(preg_match('/((\/\*)|(\*\/)|(\\n)|(expression))/i', $style)) return true;
return false;
}
function _isHackedSrc($src) {
if(!$src) return false;
if($src) {
@ -700,6 +690,9 @@
$val = strtolower(trim(substr($tmp_str,$pos+1)));
if( ($key=='module'&&$val=='admin') || ($key=='act'&&preg_match('/admin/i',$val)) ) return true;
}
$target = trim($src);
if(preg_match('/(\s|(\&\#)|(script:))/i', $target)) return true;
}
return false;
}
@ -894,6 +887,7 @@
}
}
$security_msg = "<div style='border: 1px solid #DDD; background: #FAFAFA; text-align:center; margin: 1em 0;'><p style='margin: 1em;'>".Context::getLang('security_warning_embed')."</p></div>";
$content = preg_replace('/<object[^>]+>(.*?<\/object>)?/is', $security_msg, $content);
$content = preg_replace('/<embed[^>]+>(\s*<\/embed>)?/is', $security_msg, $content);
$content = preg_replace('/<img[^>]+editor_component="multimedia_link"[^>]*>(\s*<\/img>)?/is', $security_msg, $content);
}

View file

@ -30,6 +30,6 @@
$lang->cmd_download = "Download";
$lang->view_installed_packages = "Installed Packages";
$lang->msg_ftp_password_input = "Please input FTP password.";
$lang->dependant_list = "이 패키지에 의존하는 패키지 목록";
$lang->description_uninstall = "패키지를 삭제합니다. 모듈의 경우 모든 데이터가 사라집니다.";
$lang->dependant_list = "Dependant package list of current package";
$lang->description_uninstall = "Package will be uninstalled. For modules, all data will be deleted.";
?>

View file

@ -23,7 +23,7 @@
// 컴포넌트의 종류를 구해옴
$oEditorModel = &getModel('editor');
$component_list = $oEditorModel->getComponentList(false, $site_srl);
$component_list = $oEditorModel->getComponentList(false, $site_srl, true);
Context::set('component_list', $component_list);

View file

@ -555,9 +555,9 @@
/**
* @brief component 목록을 return (DB정보 보함)
**/
function getComponentList($filter_enabled = true, $site_srl=0) {
function getComponentList($filter_enabled = true, $site_srl=0, $from_db=false) {
$cache_file = $this->getCacheFile(false, $site_srl);
if(!file_exists($cache_file)) {
if($from_db || !file_exists($cache_file)) {
$oEditorController = &getController('editor');
$oEditorController->makeCache(false, $site_srl);
}
@ -581,6 +581,7 @@
FileHandler::removeFile($cache_file);
return $this->getComponentList($filter_enabled, $site_srl);
}
if(!$filter_enabled) continue;
if($val->enabled == "N") {
unset($component_list->{$key});
continue;

View file

@ -1232,6 +1232,7 @@
**/
function putSignature($member_srl, $signature) {
$signature = trim(removeHackTag($signature));
$signature = preg_replace('/<(\/?)(embed|object|param)/is', '&lt;$1$2', $signature);
$check_signature = trim(str_replace(array('&nbsp;',"\n","\r"),'',strip_tags($signature,'<img><object>')));
$path = sprintf('files/member_extra_info/signature/%s/', getNumberingPath($member_srl));

View file

@ -21,6 +21,7 @@
<!--@end-->
<!--// datepicker javascript plugin load -->
<!--%load_js_plugin("ui")-->
<!--%load_js_plugin("ui.datepicker")-->
<h3>{$lang->msg_update_member}</h3>
@ -122,6 +123,7 @@
<input type="hidden" name="birthday" value="{$member_info->birthday}" />
<input type="text" class="inputDate" value="{zdate($member_info->birthday,'Y-m-d')}" readonly="readonly" />
<span class="button"><input type="button" value="{$lang->cmd_delete}" class="dateRemover" /></span>
<p>{$lang->about_birthday}</p>
</td>
@ -229,6 +231,7 @@
<!--@elseif($val->column_type == 'date')-->
<input type="hidden" name="{$val->column_name}" id="date_{$val->column_name}" value="{$val->value}" />
<input type="text" class="inputDate" value="{zdate($val->value,'Y-m-d')}" />
<span class="button"><input type="button" value="{$lang->cmd_delete}" class="dateRemover" /></span>
@ -279,6 +282,9 @@
};
$.extend(option,$.datepicker.regional['{$lang_type}']);
$(".inputDate").datepicker(option);
$(".dateRemover").click(function() {
$(this).parent().prevAll('input').val('');
return false;});
});
})(jQuery);
</script>

View file

@ -3,6 +3,7 @@
<!--%import("filter/signup.xml")-->
<!--// datepicker javascript plugin load -->
<!--%load_js_plugin("ui")-->
<!--%load_js_plugin("ui.datepicker")-->
<!--#include("./common_header.html")-->
@ -71,7 +72,9 @@
<th><div>{$lang->birthday}</div></th>
<td>
<input type="hidden" name="birthday" id="date_birthday" value="" />
<input type="text" value="" readonly="readonly" class="inputDate inputTypeText" /><p>{$lang->about_birthday}</p>
<input type="text" value="" readonly="readonly" class="inputDate inputTypeText" />
<span class="button"><input type="button" value="{$lang->cmd_delete}" class="dateRemover" /></span>
<p>{$lang->about_birthday}</p>
</td>
</tr>
<tr>
@ -172,6 +175,7 @@
<!--@elseif($val->column_type == 'date')-->
<input type="hidden" name="{$val->column_name}" id="date_{$val->column_name}" value="{$val->value}" />
<input type="text" class="inputDate inputTypeText" value="{zdate($val->value,'Y-m-d')}" readonly="readonly" />
<span class="button"><input type="button" value="{$lang->cmd_delete}" class="dateRemover" /></span>
<!--@end-->
<p>{$val->description}</p>
@ -202,6 +206,9 @@
};
$.extend(option,$.datepicker.regional['{$lang_type}']);
$(".inputDate").datepicker(option);
$(".dateRemover").click(function() {
$(this).parent().prevAll('input').val('');
return false;});
});
})(jQuery);
</script>