我正在尝试在我的 php 字符串中找出 open() 和 close() 的脚本标记。请在下面找到我的代码
public function custom_xss_clean($str){
if(!preg_match('/(<\/?)(script|html)(>*)/i', $str)){
return true;
} else {
$this->form_validation->set_message('custom_xss_clean','The %s field invalid');
return false;
}
}
此代码在在线工具中运行良好,但在我的字符串代码中运行良好
<script>alert(10)</script>
我尝试了很多模式,但没有运气。请提前帮助谢谢。