Skip to content

Commit

Permalink
REQUEST_URI 활용 시 허용되지 않은 문자열이 포함될 수 있는 문제 고침
Browse files Browse the repository at this point in the history
- @KinJin 기진님께서 문제점과 해결 방법을 알려주셨습니다
  • Loading branch information
bnu committed Aug 1, 2018
1 parent 1bbff0c commit 124d119
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions config/func.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ function getFullSiteUrl()
function getCurrentPageUrl()
{
$protocol = $_SERVER['HTTPS'] == 'on' ? 'https://' : 'http://';
$url = $protocol . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
$url = $protocol . $_SERVER['HTTP_HOST'] . preg_replace('/[<>"]/', '', $_SERVER['REQUEST_URI']);
return htmlspecialchars($url, ENT_COMPAT, 'UTF-8', FALSE);
}

Expand Down Expand Up @@ -1365,7 +1365,7 @@ function getScriptPath()
*/
function getRequestUriByServerEnviroment()
{
return str_replace('<', '&lt;', $_SERVER['REQUEST_URI']);
return str_replace('<', '&lt;', preg_replace('/[<>"]/', '', $_SERVER['REQUEST_URI']));
}

/**
Expand Down

0 comments on commit 124d119

Please sign in to comment.