Merge branch 'g5'

This commit is contained in:
chicpro
2015-05-18 17:33:12 +09:00
5 changed files with 35 additions and 6 deletions

View File

@ -32,6 +32,9 @@ $msg2 = str_replace("\\n", "<br>", $msg);
if (!$url) $url = $_SERVER['HTTP_REFERER'];
// url 체크
check_url_host($url);
if($error) {
$header2 = "다음 항목에 오류가 있습니다.";
} else {

View File

@ -1,6 +1,11 @@
<?php
include_once('./_common.php');
include_once(G5_PATH.'/head.sub.php');
// url 체크
check_url_host($url1);
check_url_host($url2);
check_url_host($url3);
?>
<script>

View File

@ -6,12 +6,8 @@ include_once('./_head.sub.php');
$url = $_GET['url'];
$p = parse_url($url);
if ((isset($p['scheme']) && $p['scheme']) || (isset($p['host']) && $p['host'])) {
//print_r2($p);
if ($p['host'].(isset($p['port']) ? ':'.$p['port'] : '') != $_SERVER['HTTP_HOST'])
alert('url에 타 도메인을 지정할 수 없습니다.');
}
// url 체크
check_url_host($url);
// 이미 로그인 중이라면
if ($is_member) {

View File

@ -65,6 +65,9 @@ if ($auto_login) {
}
if ($url) {
// url 체크
check_url_host($url);
$link = urldecode($url);
// 2003-06-14 추가 (다른 변수들을 넘겨주기 위함)
if (preg_match("/\?/", $link))

View File

@ -2859,4 +2859,26 @@ function check_password($pass, $hash)
return ($password === $hash);
}
// 동일한 host url 인지
function check_url_host($url, $msg='', $return_url=G5_URL)
{
if(!$msg)
$msg = 'url에 타 도메인을 지정할 수 없습니다.';
$p = parse_url($url);
if ((isset($p['scheme']) && $p['scheme']) || (isset($p['host']) && $p['host'])) {
if ($p['host'].(isset($p['port']) ? ':'.$p['port'] : '') != $_SERVER['HTTP_HOST']) {
echo '<script>'.PHP_EOL;
echo 'alert("url에 타 도메인을 지정할 수 없습니다.");'.PHP_EOL;
echo 'document.location.href = "'.$return_url.'";'.PHP_EOL;
echo '</script>'.PHP_EOL;
echo '<noscript>'.PHP_EOL;
echo '<p>'.$msg.'</p>'.PHP_EOL;
echo '<p><a href="'.$return_url.'">돌아가기</a></p>'.PHP_EOL;
echo '</noscript>'.PHP_EOL;
exit;
}
}
}
?>