diff --git a/addons/resize_image/css/resize_image.mobile.css b/addons/resize_image/css/resize_image.mobile.css index a62075411..53d753413 100644 --- a/addons/resize_image/css/resize_image.mobile.css +++ b/addons/resize_image/css/resize_image.mobile.css @@ -1 +1 @@ -.xe_content img { max-width:100%; height:auto; } +.xe_content img{max-width:100%;height:auto !important} diff --git a/addons/resize_image/js/resize_image.js b/addons/resize_image/js/resize_image.js index be1e197eb..c1de9b2ae 100644 --- a/addons/resize_image/js/resize_image.js +++ b/addons/resize_image/js/resize_image.js @@ -90,10 +90,14 @@ function getScreen() { $("#xe_gallery_controls,#xe_gallery_screen").css({ display:"block", - width : clientWidth + "px", - height : clientHeight + "px", - left : $(document).scrollLeft(), - top : $(document).scrollTop() + width : $(document).width() + "px", + height : $(document).height() + "px", + left : 0, + top : 0 + //width : clientWidth + "px", + //height : clientHeight + "px", + // left : $(document).scrollLeft(), + // top : $(document).scrollTop() }); closebtn.css("left", Math.round((clientWidth-60)/2) + "px"); @@ -126,8 +130,13 @@ function getScreen() { if(!src) src = this.list.eq(this.index).attr("src"); imgframe.attr("src", src).css({ - left : Math.round( Math.max( (clientWidth-imgframe.width()-14)/2, 0 ) ) + "px", - top : Math.round( Math.max( (clientHeight-imgframe.height()-14)/2, 0 ) ) + "px" + left : Math.round( Math.max( parseInt($(document).scrollLeft()) + (clientWidth-imgframe.width()-14)/2, 0 ) ) + "px", + top : Math.round( Math.max( parseInt($(document).scrollTop()) + (clientHeight-imgframe.height()-14)/2, 0 ) ) + "px" + }); + + closebtn.css({ + left : Math.round( Math.max( parseInt($(document).scrollLeft()) + (clientWidth-closebtn.width())/2, 0 ) ) + "px", + top : Math.round( Math.max( parseInt($(document).scrollTop()) + 10, 0 ) ) + "px" }); }; diff --git a/addons/resize_image/js/resize_image.min.js b/addons/resize_image/js/resize_image.min.js index 659fd9f56..fe8f24f84 100644 --- a/addons/resize_image/js/resize_image.min.js +++ b/addons/resize_image/js/resize_image.min.js @@ -1,9 +1,7 @@ /** * @brief 화면내에서 상위 영역보다 이미지가 크면 리사이즈를 하고 클릭시 원본을 보여줄수 있도록 변경 **/ -(function($){var xScreen=null;function getScreen(){var body=$(document.body);var controls,imgframe,closebtn,prevbtn,nextbtn;if(!xScreen){xScreen=$("
").attr("id","xe_gallery_screen").css({position:"absolute",display:"none",backgroundColor:"black",zIndex:500,opacity:0.5});controls=$("
").attr("id","xe_gallery_controls").css({position:"absolute",display:"none",overflow:"hidden",zIndex:510});closebtn=$("").attr("id","xe_gallery_closebtn").attr("src",request_uri+"addons/resize_image/iconClose.png").css({top:"10px"}).click(function(){xScreen.xeHide()}).appendTo(controls);prevbtn=$("").attr("id","xe_gallery_prevbtn").attr("src",request_uri+"addons/resize_image/iconLeft.png").css("left","10px").click(function(){xScreen.xePrev()}).appendTo(controls);nextbtn=$("").attr("id","xe_gallery_nextbtn").attr("src",request_uri+"addons/resize_image/iconRight.png").css("right","10px").click(function(){xScreen.xeNext()}).appendTo(controls);controls.find("img").attr({width:60,height:60,className:"iePngFix"}).css({position:"absolute",width:"60px",height:"60px",zIndex:530,cursor:"pointer"});imgframe=$("").attr("id","xe_gallery_holder").css("border","7px solid white").css("zIndex",520).appendTo(controls).draggable();body.append(xScreen).append(controls);xScreen.xeShow=function(){var clientWidth=$(window).width();var clientHeight=$(window).height();$("#xe_gallery_controls,#xe_gallery_screen").css({display:"block",width:clientWidth+"px",height:clientHeight+"px",left:$(document).scrollLeft(),top:$(document).scrollTop()});closebtn.css("left",Math.round((clientWidth-60)/2)+"px");$("#xe_gallery_prevbtn,#xe_gallery_nextbtn").css("top",Math.round((clientHeight-60)/2)+"px");this.xeMove(0);};xScreen.xeHide=function(event){xScreen.css("display","none");controls.css("display","none");};xScreen.xePrev=function(){this.xeMove(-1);};xScreen.xeNext=function(){this.xeMove(1);};xScreen.xeMove=function(val){var clientWidth=$(window).width();var clientHeight=$(window).height();this.index+=val;prevbtn.css("visibility",(this.index>0)?"visible":"hidden");nextbtn.css("visibility",(this.index
');function doResize(contentWidth,count){if(!count)count=0;if(count>=10)return;var $img=this;var beforSize={'width':$img.width(),'height':$img.height()};if(!beforSize.width||!beforSize.height){setTimeout(function(){doResize.call($img,contentWidth,++count)},200);return;} -if(beforSize.width<=contentWidth)return;var resize_ratio=contentWidth/beforSize.width;$img.removeAttr('width').removeAttr('height').css({'width':contentWidth,'height':parseInt(beforSize.height*resize_ratio,10)});} -$('div.xe_content').each(function(){dummy.appendTo(this);var contentWidth=dummy.width();dummy.remove();if(!contentWidth)return;$('img',this).each(function(){var $img=$(this);var imgSrc=$img.attr('src');if(regx_skip.test(imgSrc)&&!regx_allow_i6pngfix.test(imgSrc))return;$img.attr('rel','xe_gallery');doResize.call($img,contentWidth);});$('img[rel=xe_gallery]',this).live('mouseover',function(){var $img=$(this);if(!$img.parent('a').length&&!$img.attr('onclick')){$img.css('cursor','pointer').click(slideshow);}});});});})(jQuery); +(function($){var xScreen=null +function getScreen(){var body=$(document.body),controls,imgframe,closebtn,prevbtn,nextbtn;if(!xScreen){xScreen=$("
").attr("id","xe_gallery_screen").css({position:"absolute",display:"none",backgroundColor:"black",zIndex:500,opacity:0.5});controls=$("
").attr("id","xe_gallery_controls").css({position:"absolute",display:"none",overflow:"hidden",zIndex:510});closebtn=$("").attr("id","xe_gallery_closebtn").attr("src",request_uri+"addons/resize_image/iconClose.png").css({top:"10px"}).click(function(){xScreen.xeHide()}).appendTo(controls);prevbtn=$("").attr("id","xe_gallery_prevbtn").attr("src",request_uri+"addons/resize_image/iconLeft.png").css("left","10px").click(function(){xScreen.xePrev()}).appendTo(controls);nextbtn=$("").attr("id","xe_gallery_nextbtn").attr("src",request_uri+"addons/resize_image/iconRight.png").css("right","10px").click(function(){xScreen.xeNext()}).appendTo(controls);controls.find("img").attr({width:60,height:60,className:"iePngFix"}).css({position:"absolute",width:"60px",height:"60px",zIndex:530,cursor:"pointer"});imgframe=$("").attr("id","xe_gallery_holder").css("border","7px solid white").css("zIndex",520).appendTo(controls).draggable();body.append(xScreen).append(controls);xScreen.xeShow=function(){var clientWidth=$(window).width(),clientHeight=$(window).height();$("#xe_gallery_controls,#xe_gallery_screen").css({display:"block",width:$(document).width()+"px",height:$(document).height()+"px",left:0,top:0});closebtn.css("left",Math.round((clientWidth-60)/2)+"px");$("#xe_gallery_prevbtn,#xe_gallery_nextbtn").css("top",Math.round((clientHeight-60)/2)+"px");this.xeMove(0)};xScreen.xeHide=function(event){xScreen.css("display","none");controls.css("display","none")};xScreen.xePrev=function(){this.xeMove(-1)};xScreen.xeNext=function(){this.xeMove(1)};xScreen.xeMove=function(val){var clientWidth=$(window).width(),clientHeight=$(window).height();this.index+=val;prevbtn.css("visibility",(this.index>0)?"visible":"hidden");nextbtn.css("visibility",(this.index
') +function doResize(contentWidth,count){if(!count)count=0;if(count>=10)return;var $img=this,beforSize={width:$img.width(),height:$img.height()};if(!beforSize.width||!beforSize.height){setTimeout(function(){doResize.call($img,contentWidth,++count)},200);return};if(beforSize.width<=contentWidth)return;var resize_ratio=contentWidth/beforSize.width;$img.removeAttr('width').removeAttr('height').css({width:contentWidth,height:parseInt(beforSize.height*resize_ratio,10)})};$('div.xe_content').each(function(){var contentWidth=dummy.appendTo(this).width();dummy.remove();if(!contentWidth)return;$('img',this).each(function(){var $img=$(this),imgSrc=$img.attr('src');if(regx_skip.test(imgSrc)&&!regx_allow_i6pngfix.test(imgSrc))return;$img.attr('rel','xe_gallery');doResize.call($img,contentWidth)});$('img[rel=xe_gallery]',this).live('mouseover',function(){var $img=$(this);if(!$img.parent('a').length&&!$img.attr('onclick'))$img.css('cursor','pointer').click(slideshow)})})})})(jQuery) \ No newline at end of file diff --git a/classes/module/ModuleHandler.class.php b/classes/module/ModuleHandler.class.php index 678abf9cf..d36f24ed3 100644 --- a/classes/module/ModuleHandler.class.php +++ b/classes/module/ModuleHandler.class.php @@ -151,7 +151,17 @@ $this->mid = $module_info->mid; $this->module_info = $module_info; Context::setBrowserTitle($module_info->browser_title); - $part_config= $oModuleModel->getModulePartConfig('layout',$module_info->layout_srl); + + if($module_info->use_mobile && Mobile::isFromMobilePhone()) + { + $layoutSrl = $module_info->mlayout_srl; + } + else + { + $layoutSrl = $module_info->layout_srl; + } + + $part_config= $oModuleModel->getModulePartConfig('layout',$layoutSrl); Context::addHtmlHeader($part_config->header_script); } diff --git a/classes/template/TemplateHandler.class.php b/classes/template/TemplateHandler.class.php index 31de9b8f4..050adf159 100644 --- a/classes/template/TemplateHandler.class.php +++ b/classes/template/TemplateHandler.class.php @@ -187,7 +187,7 @@ class TemplateHandler { $buff = preg_replace('@@s', '', $buff); // replace value of src in img/input/script tag - $buff = preg_replace_callback('/<(?:img|input|script)(?:(?!["\'\/]\s*>).)* src="(?!https?:\/\/|[\/\{])([^"]+)"/is', array($this, '_replacePath'), $buff); + $buff = preg_replace_callback('/<(?:img|input|script)[^<>]*src="(?!https?:\/\/|[\/\{])([^"]+)"/is', array($this, '_replacePath'), $buff); // replace loop and cond template syntax $buff = $this->_parseInline($buff); @@ -223,6 +223,7 @@ class TemplateHandler { * @param array $matches * @return string **/ + function _compileFormAuthGeneration($matches) { // form ruleset attribute move to hidden tag diff --git a/classes/xml/xmlquery/argument/Argument.class.php b/classes/xml/xmlquery/argument/Argument.class.php index 5ac884869..def8b2814 100644 --- a/classes/xml/xmlquery/argument/Argument.class.php +++ b/classes/xml/xmlquery/argument/Argument.class.php @@ -163,11 +163,50 @@ class Argument { * @return string */ function _escapeStringValue($value) { + // Remove non-utf8 chars. + $regex = <<<'END' +/ +( + (?: + [\x00-\x7F] # single-byte sequences 0xxxxxxx + |[\xC0-\xDF][\x80-\xBF] # double-byte sequences 110xxxxx 10xxxxxx + |[\xE0-\xEF][\x80-\xBF]{2} # triple-byte sequences 1110xxxx 10xxxxxx * 2 + )+ +) +|([\xF0-\xF7][\x80-\xBF]{3}) # quadruple-byte sequence 11110xxx 10xxxxxx * 3 +|([\x80-\xBF]) # invalid byte in range 10000000 - 10111111 +|([\xC0-\xFF]) # invalid byte in range 11000000 - 11111111 +/x +END; + + $value = preg_replace_callback($regex, array($this, 'utf8Replacer'), $value); $db = &DB::getInstance(); $value = $db->addQuotes($value); return '\'' . $value . '\''; } + function utf8Replacer($captures) { + if (!empty($captures[1])) + { + // Valid byte sequence. Return unmodified. + return $captures[1]; + } + elseif(!empty($captures[2])) + { + // Remove user defined area + if("\xF3\xB0\x80\x80" <= $captures[2]) + { + return; + } + + return $captures[2]; + } + else + { + return; + } + } + function isValid() { return $this->isValid; } diff --git a/common/js/common.js b/common/js/common.js index 6cb9b8bbc..bb8128aae 100644 --- a/common/js/common.js +++ b/common/js/common.js @@ -364,18 +364,18 @@ function sendMailTo(to) { /** * @brief url이동 (open_window 값이 N 가 아니면 새창으로 띄움) **/ -function move_url(url, open_wnidow) { +function move_url(url, open_window) { if(!url) return false; - if(typeof(open_wnidow) == 'undefined') open_wnidow = 'N'; - if(open_wnidow=='N') { - open_wnidow = false; + if(typeof(open_window) == 'undefined') open_window = 'N'; + if(open_window=='N') { + open_window = false; } else { - open_wnidow = true; + open_window = true; } if(/^\./.test(url)) url = request_uri+url; - if(open_wnidow) { + if(open_window) { winopen(url); } else { location.href=url; diff --git a/common/js/xe.js b/common/js/xe.js index 62d8af7fe..345459888 100644 --- a/common/js/xe.js +++ b/common/js/xe.js @@ -648,18 +648,18 @@ function sendMailTo(to) { /** * @brief url이동 (open_window 값이 N 가 아니면 새창으로 띄움) **/ -function move_url(url, open_wnidow) { +function move_url(url, open_window) { if(!url) return false; - if(typeof(open_wnidow) == 'undefined') open_wnidow = 'N'; - if(open_wnidow=='N') { - open_wnidow = false; + if(typeof(open_window) == 'undefined') open_window = 'N'; + if(open_window=='N') { + open_window = false; } else { - open_wnidow = true; + open_window = true; } if(/^\./.test(url)) url = request_uri+url; - if(open_wnidow) { + if(open_window) { winopen(url); } else { location.href=url; diff --git a/common/lang/lang.xml b/common/lang/lang.xml index ec929ff94..b5ededcbd 100644 --- a/common/lang/lang.xml +++ b/common/lang/lang.xml @@ -2935,6 +2935,10 @@ + + + + diff --git a/config/func.inc.php b/config/func.inc.php index 7368dbc6b..67ff1c780 100644 --- a/config/func.inc.php +++ b/config/func.inc.php @@ -326,7 +326,7 @@ $request_uri = Context::getRequestUri(); if(!$num_args) return $request_uri; - $url = Context::getUrl($num_args, $args_list); + $url = Context::getUrl($num_args, $args_list, null, false); if(!preg_match('/^http/i',$url)){ preg_match('/^(http|https):\/\/([^\/]+)\//',$request_uri,$match); $url = Context::getUrl($num_args, $args_list, null, false); diff --git a/libs/tar.class.php b/libs/tar.class.php index 66294278d..7536e17f4 100644 --- a/libs/tar.class.php +++ b/libs/tar.class.php @@ -99,6 +99,10 @@ class tar { // PRIVATE ACCESS FUNCTION function __parseNullPaddedString($string) { $position = strpos($string,chr(0)); + if(!$position) + { + $position = strlen($string); + } return substr($string,0,$position); } @@ -109,6 +113,7 @@ class tar { // Read Files from archive $tar_length = strlen($this->tar_file); $main_offset = 0; + $flag_longlink = false; while($main_offset < $tar_length) { // If we read a block of 512 nulls, we are at the end of the archive if(substr($this->tar_file,$main_offset,512) == str_repeat(chr(0),512)) @@ -141,6 +146,8 @@ class tar { // Parse Group name $file_gname = $this->__parseNullPaddedString(substr($this->tar_file,$main_offset + 297,32)); + $file_type = substr($this->tar_file,$main_offset + 156,1); + // Make sure our file is valid if($this->__computeUnsignedChecksum(substr($this->tar_file,$main_offset,512)) != $file_chksum) return false; @@ -159,42 +166,67 @@ class tar { $activeFile["endheader"] = substr($this->tar_file,$main_offset + 500,12); */ - if($file_size > 0) { - // Increment number of files - $this->numFiles++; + if(strtolower($file_type) == 'l' || $file_name == '././@LongLink') + { + $flag_longlink = true; + $longlink_name = $this->__parseNullPaddedString($file_contents); + } + elseif($file_type == '0') { + // Increment number of files + $this->numFiles++; - // Create us a new file in our array - $activeFile = &$this->files[]; + // Create us a new file in our array + $activeFile = &$this->files[]; - // Asign Values - $activeFile["name"] = $file_name; - $activeFile["mode"] = $file_mode; - $activeFile["size"] = $file_size; - $activeFile["time"] = $file_time; - $activeFile["user_id"] = $file_uid; - $activeFile["group_id"] = $file_gid; - $activeFile["user_name"] = $file_uname; - $activeFile["group_name"] = $file_gname; - $activeFile["checksum"] = $file_chksum; - $activeFile["file"] = $file_contents; + // Asign Values + if($flag_longlink) + { + $activeFile["name"] = $longlink_name; + } + else + { + $activeFile["name"] = $file_name; + } + $activeFile["type"] = $file_type; + $activeFile["mode"] = $file_mode; + $activeFile["size"] = $file_size; + $activeFile["time"] = $file_time; + $activeFile["user_id"] = $file_uid; + $activeFile["group_id"] = $file_gid; + $activeFile["user_name"] = $file_uname; + $activeFile["group_name"] = $file_gname; + $activeFile["checksum"] = $file_chksum; + $activeFile["file"] = $file_contents; - } else { - // Increment number of directories - $this->numDirectories++; + $flag_longlink = false; - // Create a new directory in our array - $activeDir = &$this->directories[]; + } elseif($file_type == '5') { + // Increment number of directories + $this->numDirectories++; - // Assign values - $activeDir["name"] = $file_name; - $activeDir["mode"] = $file_mode; - $activeDir["time"] = $file_time; - $activeDir["user_id"] = $file_uid; - $activeDir["group_id"] = $file_gid; - $activeDir["user_name"] = $file_uname; - $activeDir["group_name"] = $file_gname; - $activeDir["checksum"] = $file_chksum; - } + // Create a new directory in our array + $activeDir = &$this->directories[]; + + // Assign values + if($flag_longlink) + { + $activeDir["name"] = $longlink_name; + } + else + { + $activeDir["name"] = $file_name; + } + $activeDir["type"] = $file_type; + $activeDir["mode"] = $file_mode; + $activeDir["time"] = $file_time; + $activeDir["user_id"] = $file_uid; + $activeDir["group_id"] = $file_gid; + $activeDir["user_name"] = $file_uname; + $activeDir["group_name"] = $file_gname; + $activeDir["checksum"] = $file_chksum; + + $flag_longlink = false; + } // Move our offset the number of blocks we have processed $main_offset += 512 + (ceil($file_size / 512) * 512); diff --git a/modules/admin/tpl/js/admin.js b/modules/admin/tpl/js/admin.js index 240bc2348..1b21c494b 100644 --- a/modules/admin/tpl/js/admin.js +++ b/modules/admin/tpl/js/admin.js @@ -942,10 +942,10 @@ $('.multiLangEdit') function on_complete(data, idx){ var results = data.results, $btn, i, c; - if(data.error || !results || (r_idx != idx+1)) return; - $this.removeClass('loading'); + if(data.error || !results || results.length === 0 || (r_idx != idx+1)) return; + $ul.empty(); for(i=0,c=results.length; i < c; i++) { $btn = $('
- + + + +
diff --git a/modules/rss/tpl/rss_module_config.html b/modules/rss/tpl/rss_module_config.html index 85b2c3038..431ece1ef 100644 --- a/modules/rss/tpl/rss_module_config.html +++ b/modules/rss/tpl/rss_module_config.html @@ -1,9 +1,9 @@
- - - - - + + + + +

{$lang->open_rss}

{$lang->about_open_rss}

diff --git a/modules/spamfilter/spamfilter.controller.php b/modules/spamfilter/spamfilter.controller.php index 525d896a3..e0d889b92 100644 --- a/modules/spamfilter/spamfilter.controller.php +++ b/modules/spamfilter/spamfilter.controller.php @@ -140,7 +140,7 @@ $ipaddress_list = str_replace("\r","",$ipaddress_list); $ipaddress_list = explode("\n",$ipaddress_list); foreach($ipaddress_list as $ipaddressValue) { - preg_match("/(\d{1,3}(?:.(\d{1,3}|\*)){3})\s*(\/\/\s*(.*))?/",$ipaddressValue,$matches); + preg_match("/(\d{1,3}(?:.(\d{1,3}|\*)){3})\s*(\/\/(.*)\s*)?/",$ipaddressValue,$matches); if($ipaddress=trim($matches[1])) { $args->ipaddress = $ipaddress; if(!$description && $matches[4]) $args->description = $matches[4]; diff --git a/modules/spamfilter/tpl/js/spamfilter_admin.js b/modules/spamfilter/tpl/js/spamfilter_admin.js index 46a42623a..3d8e6bd74 100644 --- a/modules/spamfilter/tpl/js/spamfilter_admin.js +++ b/modules/spamfilter/tpl/js/spamfilter_admin.js @@ -21,8 +21,8 @@ function doDeleteDeniedWord(word) { } function doInsertDeniedIP(msg_invalid_format){ var fo_obj = get_by_id('spamfilterInsert'); - var reg_ipaddress = /^(\d{1,3}(?:.(\d{1,3}|\*)){3}\s*(\/\/[^\r\n]*)?[\r\n]*)*$/; - var matchStr_ipaddress = fo_obj.ipaddressList.value; + var reg_ipaddress = /^((\d{1,3}(?:.(\d{1,3}|\*)){3})\s*(\/\/(.*)\s*)?)*\s*$/; + var matchStr_ipaddress = fo_obj.ipaddress_list.value; if(!matchStr_ipaddress.match(reg_ipaddress)) { alert(msg_invalid_format); return false; } @@ -32,8 +32,8 @@ function doInsertDeniedIP(msg_invalid_format){ } function doInsertDeniedWord(msg_invalid_format){ var fo_obj = get_by_id('spamfilterInsert'); - var reg_word = /^(.{2,40}[\r\n]+)*.{0,40}$/; - var matchStr_word = fo_obj.wordList.value; + var reg_word = /^(.{2,40}\s*)*$/; + var matchStr_word = fo_obj.word_list.value; if(!matchStr_word.match(reg_word)) { alert(msg_invalid_format); return false; } diff --git a/widgets/counter_status/counter_status.class.php b/widgets/counter_status/counter_status.class.php index 4792ff718..717c33fca 100644 --- a/widgets/counter_status/counter_status.class.php +++ b/widgets/counter_status/counter_status.class.php @@ -19,11 +19,15 @@ $site_module_info = Context::get('site_module_info'); $output = $oCounterModel->getStatus(array('00000000', date('Ymd', time()-60*60*24), date('Ymd')), $site_module_info->site_srl); - foreach($output as $key => $val) { - if(!$key) Context::set('total_counter', $val); - elseif($key == date("Ymd")) Context::set('today_counter', $val); - else Context::set('yesterday_counter', $val); - } + if(count($output)) + { + foreach($output as $key => $val) + { + if(!$key) Context::set('total_counter', $val); + elseif($key == date("Ymd")) Context::set('today_counter', $val); + else Context::set('yesterday_counter', $val); + } + } // Set a path of the template skin (values of skin, colorset settings) $tpl_path = sprintf('%sskins/%s', $this->widget_path, $args->skin); Context::set('colorset', $args->colorset);