From 2e73720fb98124d639bafb3c4aca359612531bb9 Mon Sep 17 00:00:00 2001 From: zero Date: Wed, 30 Jan 2008 02:44:36 +0000 Subject: [PATCH] =?UTF-8?q?=ED=8F=AC=EC=9D=B8=ED=8A=B8=20=EB=9E=AD?= =?UTF-8?q?=ED=82=B9=20=EC=9C=84=EC=A0=AF=20=EC=98=A4=EB=A5=98=20=EC=88=98?= =?UTF-8?q?=EC=A0=95=20=EB=B0=8F=20=EC=9C=84=EC=A0=AF=EC=9D=98=20=EB=B3=80?= =?UTF-8?q?=EC=88=98=EB=AA=85=EC=97=90=20=EC=82=AC=EC=9A=A9=EB=90=98?= =?UTF-8?q?=EB=8A=94=20javascript=20escape=EC=9D=98=20php=20unescape=20?= =?UTF-8?q?=EC=BD=94=EB=93=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: http://xe-core.googlecode.com/svn/sandbox@3621 201d5d3c-b55e-5fd7-737f-ddc643e51545 --- classes/widget/WidgetHandler.class.php | 2 +- config/func.inc.php | 16 ++++++++++++++-- widgets/rank_point/rank_point.class.php | 2 ++ 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/classes/widget/WidgetHandler.class.php b/classes/widget/WidgetHandler.class.php index 1fe6a6f2d..ccbc26345 100644 --- a/classes/widget/WidgetHandler.class.php +++ b/classes/widget/WidgetHandler.class.php @@ -83,7 +83,7 @@ if(count($object_vars)) { foreach($object_vars as $key => $val) { if(in_array($key, array('body','class','style','widget_sequence','widget','widget_padding_left','widget_padding_top','widget_padding_bottom','widget_padding_right'))) continue; - $args->{$key} = utf8RawUrlDecode(utf8RawUrlDecode($val)); + $args->{$key} = utf8RawUrlDecode($val); } } diff --git a/config/func.inc.php b/config/func.inc.php index 5ac341df6..6cdb5ed08 100644 --- a/config/func.inc.php +++ b/config/func.inc.php @@ -471,6 +471,11 @@ return preg_replace('/index.php/i','',$_SERVER['SCRIPT_NAME']); } + /** + * javascript의 escape의 php unescape 함수 + * Function converts an Javascript escaped string back into a string with specified charset (default is UTF-8). + * Modified function from http://pure-essence.net/stuff/code/utf8RawUrlDecode.phps + **/ function utf8RawUrlDecode ($source) { $decodedStr = ""; $pos = 0; @@ -485,8 +490,7 @@ $pos++; $unicodeHexVal = substr ($source, $pos, 4); $unicode = hexdec ($unicodeHexVal); - $entity = "&#". $unicode . ';'; - $decodedStr .= utf8_encode ($entity); + $decodedStr .= _code2utf($unicode); $pos += 4; } else { @@ -502,4 +506,12 @@ } return $decodedStr; } + + function _code2utf($num){ + if($num<128)return chr($num); + if($num<2048)return chr(($num>>6)+192).chr(($num&63)+128); + if($num<65536)return chr(($num>>12)+224).chr((($num>>6)&63)+128).chr(($num&63)+128); + if($num<2097152)return chr(($num>>18)+240).chr((($num>>12)&63)+128).chr((($num>>6)&63)+128) .chr(($num&63)+128); + return ''; + } ?> diff --git a/widgets/rank_point/rank_point.class.php b/widgets/rank_point/rank_point.class.php index de79b7ded..4b609926e 100644 --- a/widgets/rank_point/rank_point.class.php +++ b/widgets/rank_point/rank_point.class.php @@ -45,6 +45,8 @@ $obj->list_count = $list_count; $obj->is_admin = $args->without_admin == "true" ? "N" : ""; + $output = new Object(); + if(count($target_group) || count($target_group_without)) { // 그룹 목록을 구해옴 $group_list = $oMemberModel->getGroups();