PHP_SELF 를 이용한 XSS 취약점 수정

This commit is contained in:
chicpro
2015-06-23 11:01:07 +09:00
parent cbe9c53262
commit b4b24aadfd
3 changed files with 39 additions and 49 deletions

View File

@ -25,30 +25,8 @@ if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
</div>
<?php
if(G5_DEVICE_BUTTON_DISPLAY && G5_IS_MOBILE) {
$seq = 0;
$p = parse_url(G5_URL);
$href = $p['scheme'].'://'.$p['host'];
if(isset($p['port']) && $p['port'])
$href .= ':'.$p['port'];
$href .= $_SERVER['PHP_SELF'];
if($_SERVER['QUERY_STRING']) {
$sep = '?';
foreach($_GET as $key=>$val) {
if($key == 'device')
continue;
$href .= $sep.$key.'='.$val;
$sep = '&amp;';
$seq++;
}
}
if($seq)
$href .= '&amp;device=pc';
else
$href .= '?device=pc';
?>
<a href="<?php echo $href; ?>" id="device_change">PC 버전으로 보기</a>
if(G5_DEVICE_BUTTON_DISPLAY && G5_IS_MOBILE) { ?>
<a href="<?php echo get_device_change_url(); ?>" id="device_change">PC 버전으로 보기</a>
<?php
}