Remove invalid characters from REQUEST_URI

This commit is contained in:
Kijin Sung 2018-07-31 19:08:02 +09:00
parent b62a1322c9
commit 109203d12b
3 changed files with 11 additions and 3 deletions

View file

@ -18,7 +18,8 @@ class URL
*/
public static function getCurrentURL(array $changes = array())
{
$url = self::getCurrentDomainURL(isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '/');
$request_uri = preg_replace('/[<>"]/', '', isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '/');
$url = self::getCurrentDomainURL($request_uri);
if (count($changes))
{
return self::modifyURL($url, $changes);

View file

@ -917,7 +917,7 @@ function getScriptPath()
*/
function getRequestUriByServerEnviroment()
{
return escape($_SERVER['REQUEST_URI']);
return preg_replace('/[<>"]/', '', $_SERVER['REQUEST_URI']);
}
/**