포인트 랭킹 위젯 오류 수정 및 위젯의 변수명에 사용되는 javascript escape의 php unescape 코드 변경

git-svn-id: http://xe-core.googlecode.com/svn/sandbox@3621 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
zero 2008-01-30 02:44:36 +00:00
parent 0865bddced
commit 2e73720fb9
3 changed files with 17 additions and 3 deletions

View file

@ -83,7 +83,7 @@
if(count($object_vars)) { if(count($object_vars)) {
foreach($object_vars as $key => $val) { 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; 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);
} }
} }

View file

@ -471,6 +471,11 @@
return preg_replace('/index.php/i','',$_SERVER['SCRIPT_NAME']); 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) { function utf8RawUrlDecode ($source) {
$decodedStr = ""; $decodedStr = "";
$pos = 0; $pos = 0;
@ -485,8 +490,7 @@
$pos++; $pos++;
$unicodeHexVal = substr ($source, $pos, 4); $unicodeHexVal = substr ($source, $pos, 4);
$unicode = hexdec ($unicodeHexVal); $unicode = hexdec ($unicodeHexVal);
$entity = "&#". $unicode . ';'; $decodedStr .= _code2utf($unicode);
$decodedStr .= utf8_encode ($entity);
$pos += 4; $pos += 4;
} }
else { else {
@ -502,4 +506,12 @@
} }
return $decodedStr; 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 '';
}
?> ?>

View file

@ -45,6 +45,8 @@
$obj->list_count = $list_count; $obj->list_count = $list_count;
$obj->is_admin = $args->without_admin == "true" ? "N" : ""; $obj->is_admin = $args->without_admin == "true" ? "N" : "";
$output = new Object();
if(count($target_group) || count($target_group_without)) { if(count($target_group) || count($target_group_without)) {
// 그룹 목록을 구해옴 // 그룹 목록을 구해옴
$group_list = $oMemberModel->getGroups(); $group_list = $oMemberModel->getGroups();