浏览代码

CNVD-C-2024-690565问题修复

tags/6.3.2
tianya 4 个月前
父节点
当前提交
0a62192123
共有 1 个文件被更改,包括 5 次插入1 次删除
  1. +5
    -1
      src/system/helpers/filter.helper.php

+ 5
- 1
src/system/helpers/filter.helper.php 查看文件

@@ -24,6 +24,9 @@ if (!defined('DEDEINC')) exit ('dedebiz');
if (!function_exists('HtmlReplace')) { if (!function_exists('HtmlReplace')) {
function HtmlReplace($str, $rptype = 0) function HtmlReplace($str, $rptype = 0)
{ {
if (!is_string($str)) {
return '';
}
$str = stripslashes($str); $str = stripslashes($str);
$str = preg_replace("/<[\/]{0,1}style([^>]*)>(.*)<\/style>/i", '', $str); $str = preg_replace("/<[\/]{0,1}style([^>]*)>(.*)<\/style>/i", '', $str);
if ($rptype == 0) { if ($rptype == 0) {
@@ -39,7 +42,8 @@ if (!function_exists('HtmlReplace')) {
} else { } else {
$str = preg_replace("/[\r\n\t ]{1,}/", ' ', $str); $str = preg_replace("/[\r\n\t ]{1,}/", ' ', $str);
$str = preg_replace('/script/i', 'script', $str); $str = preg_replace('/script/i', 'script', $str);
$str = preg_replace("/<[\/]{0,1}(link|meta|ifr|fra)[^>]*>/i", '', $str);
$str = preg_replace("/<[\/]{0,1}(link|meta|iframe|frame|object|embed|form|input|button|textarea|select)[^>]*>/i", '', $str);
$str = preg_replace('/\son\w+\s*=\s*["\'][^"\']*["\']/i', '', $str);
} }
return addslashes($str); return addslashes($str);
} }


正在加载...
取消
保存