clean_xss_tags 함수 수정으로 인해 일부 입력값에서 줄바꿈이 안되는 문제 수정

This commit is contained in:
thisgun
2022-06-13 14:46:08 +09:00
parent 30da5d6b22
commit d4f554e653
10 changed files with 40 additions and 11 deletions

View File

@ -3075,10 +3075,12 @@ function get_search_string($stx)
}
// XSS 관련 태그 제거
function clean_xss_tags($str, $check_entities=0, $is_remove_tags=0, $cur_str_len=0)
function clean_xss_tags($str, $check_entities=0, $is_remove_tags=0, $cur_str_len=0, $is_trim_both=1)
{
// tab('\t'), formfeed('\f'), vertical tab('\v'), newline('\n'), carriage return('\r') 를 제거한다.
$str = preg_replace("#[\t\f\v\n\r]#", '', $str);
if( $is_trim_both ) {
// tab('\t'), formfeed('\f'), vertical tab('\v'), newline('\n'), carriage return('\r') 를 제거한다.
$str = preg_replace("#[\t\f\v\n\r]#", '', $str);
}
if( $is_remove_tags ){
$str = strip_tags($str);