Add an url-encode method to support asian language.

Cette révision appartient à :
Amio Jin 2013-09-09 17:57:11 +08:00
Parent f540c54482
révision c734ce5f2c
1 fichiers modifiés avec 7 ajouts et 1 suppressions

Voir le fichier

@ -182,6 +182,12 @@ function clean_name($text) {
return $text;
}
function RFC3986UrlEncode($string) {
$entities = array('%21', '%2A', '%27', '%28', '%29', '%3B', '%3A', '%40', '%26', '%3D', '%2B', '%24', '%2C', '%2F', '%3F', '%25', '%23', '%5B', '%5D');
$replacements = array('!', '*', "'", "(", ")", ";", ":", "@", "&", "=", "+", "$", ",", "/", "?", "%", "#", "[", "]");
return str_replace($entities, $replacements, urlencode($string));
}
function build_nav($tree, $url_params = false) {
// Remove Index
unset($tree['index']);
@ -197,7 +203,7 @@ function build_nav($tree, $url_params = false) {
array_shift($url_params);
// Final Node
if ($url_path == $val['url']) {
if ($url_path == RFC3986UrlEncode($val['url'])) {
$html .= '<li class="active">';
} else {
$html .= '<li class="open">';