mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-07 02:31:40 +09:00
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@3605 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
723b9a4545
commit
2c85caaff9
2 changed files with 33 additions and 1 deletions
|
|
@ -64,7 +64,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} = urldecode($val);
|
||||
$args->{$key} = utf8RawUrlDecode(utf8RawUrlDecode($val));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -470,4 +470,36 @@
|
|||
if(function_exists('php_sapi_name') && php_sapi_name()=='cgi') return preg_replace('/index.php/i','',$_SERVER['PATH_INFO']);
|
||||
return preg_replace('/index.php/i','',$_SERVER['SCRIPT_NAME']);
|
||||
}
|
||||
|
||||
function utf8RawUrlDecode ($source) {
|
||||
$decodedStr = "";
|
||||
$pos = 0;
|
||||
$len = strlen ($source);
|
||||
while ($pos < $len) {
|
||||
$charAt = substr ($source, $pos, 1);
|
||||
if ($charAt == '%') {
|
||||
$pos++;
|
||||
$charAt = substr ($source, $pos, 1);
|
||||
if ($charAt == 'u') {
|
||||
// we got a unicode character
|
||||
$pos++;
|
||||
$unicodeHexVal = substr ($source, $pos, 4);
|
||||
$unicode = hexdec ($unicodeHexVal);
|
||||
$entity = "&#". $unicode . ';';
|
||||
$decodedStr .= utf8_encode ($entity);
|
||||
$pos += 4;
|
||||
}
|
||||
else {
|
||||
// we have an escaped ascii character
|
||||
$hexVal = substr ($source, $pos, 2);
|
||||
$decodedStr .= chr (hexdec ($hexVal));
|
||||
$pos += 2;
|
||||
}
|
||||
} else {
|
||||
$decodedStr .= $charAt;
|
||||
$pos++;
|
||||
}
|
||||
}
|
||||
return $decodedStr;
|
||||
}
|
||||
?>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue