getUrl, getFullUrl, getSiteUrl에 대해서 getNoEncodedUrl, getNoEncodedFullUrl, getNoEncodedSiteUrl 대응 함수를 추가 (url query에 대해 htmlspecialchars를 하지 않는 함수) 하고 XE 내부적으로 redirect하는 경우 getNoEncoded*Url 함수를 이용하도록 수정

git-svn-id: http://xe-core.googlecode.com/svn/sandbox@6734 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
zero 2009-08-07 06:57:11 +00:00
parent 10c609b22c
commit 91ac64ba08
3 changed files with 44 additions and 6 deletions

View file

@ -219,6 +219,15 @@
return Context::getUrl($num_args, $args_list);
}
function getNoEncodeUrl() {
$num_args = func_num_args();
$args_list = func_get_args();
if(!$num_args) return Context::getRequestUri();
return Context::getUrl($num_args, $args_list, null, false);
}
/**
* @brief getUrl() 값에 request uri를 추가하여 reutrn
* full url을 얻기 위함
@ -238,6 +247,21 @@
return $url;
}
function getNoEncodeFullUrl() {
$num_args = func_num_args();
$args_list = func_get_args();
$request_uri = Context::getRequestUri();
if(!$num_args) return $request_uri;
$url = Context::getUrl($num_args, $args_list);
if(!preg_match('/^http/i',$url)){
preg_match('/^(http|https):\/\/([^\/]+)\//',$request_uri,$match);
$url = Context::getUrl($num_args, $args_list, null, false);
return substr($match[0],0,-1).$url;
}
return $url;
}
/**
* @brief Context::getUrl() 쓰기 쉽게 함수로 선언
* @return string
@ -257,6 +281,18 @@
return Context::getUrl($num_args, $args_list, $domain);
}
function getNoEncodedSiteUrl() {
$num_args = func_num_args();
$args_list = func_get_args();
if(!$num_args) return Context::getRequestUri();
$domain = array_shift($args_list);
$num_args = count($args_list);
return Context::getUrl($num_args, $args_list, $domain, false);
}
/**
* @brief getSiteUrl() 값에 request uri를 추가하여 reutrn
* full url을 얻기 위함