diff --git a/bbs/qawrite.php b/bbs/qawrite.php index d9ffd7b98..5a7a47345 100644 --- a/bbs/qawrite.php +++ b/bbs/qawrite.php @@ -76,7 +76,10 @@ if(is_file($skin_file)) { $content .= get_text($write['qa_content'], 0); } else { - $content = get_text($write['qa_content'], 0); + //$content = get_text($write['qa_content'], 0); + + // KISA 취약점 권고사항 Stored XSS + $content = get_text(html_purifier($write['qa_content']), 0); } $editor_html = editor_html('qa_content', $content, $is_dhtml_editor); diff --git a/common.php b/common.php index 3ed3a1d7a..d9d10e80c 100644 --- a/common.php +++ b/common.php @@ -34,7 +34,7 @@ function g5_path() $document_root = str_replace($tilde_remove, '', $_SERVER['SCRIPT_FILENAME']); $pattern = '/' . preg_quote($document_root, '/') . '/i'; $root = preg_replace($pattern, '', $result['path']); - $port = $_SERVER['SERVER_PORT'] != 80 ? ':'.$_SERVER['SERVER_PORT'] : ''; + $port = ($_SERVER['SERVER_PORT'] == 80 || $_SERVER['SERVER_PORT'] == 443) ? '' : ':'.$_SERVER['SERVER_PORT']; $http = 'http' . ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS']=='on') ? 's' : '') . '://'; $user = str_replace(preg_replace($pattern, '', $_SERVER['SCRIPT_FILENAME']), '', $_SERVER['SCRIPT_NAME']); $host = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : $_SERVER['SERVER_NAME'];