src/Request.php
private function antiHtmlArray(array $arr, array $config): void
    {
        foreach ($arr as $k => $v) {
            if (is_array($v)) {
                $this->antiHtmlArray($v, $config);
                continue;
            }

            // 如果此参数在忽略列表中,放过检查
            if (in_array($k, $config['ignoreParams'])) {
                continue;
            }

            //优先处理轻度安全参数
            if (isset($config['lightParams']) and in_array($k, $config['lightParams'])) {
                if (preg_match('/' . $config['lightDisabled'] . '/i', $v)) {
                    FileLog::instance()->antiLight($_REQUEST);
                    exit();
                }
                continue;
            }

            //其它参数,按高安全级检查
            if ($config['disabled'] and preg_match('/' . $config['disabled'] . '/i', $v)) {
                FileLog::instance()->antiHigh($_REQUEST);
                exit();
            }

            //如果参数名称非法
            if (isset($config['antiName']) and in_array($k, $config['antiName'])) {
                FileLog::instance()->antiName($_REQUEST);
                exit();
            }
        }
    }
private function antiHtmlArray(array $arr, array $config): void
    {
        foreach ($arr as $k => $v) {
            if (is_array($v)) {
                $this->antiHtmlArray($v, $config);
                continue;
            }

            // 如果此参数在忽略列表中,放过检查
            if (in_array($k, $config['ignoreParams'])) {
                continue;
            }

            //优先处理轻度安全参数
            if (isset($config['lightParams']) and in_array($k, $config['lightParams'])) {
                if (preg_match('/' . $config['lightDisabled'] . '/i', $v)) {
                    FileLog::instance()->antiLight($_REQUEST);
                    exit();
                }
                continue;
            }

            //其它参数,按高安全级检查
            if ($config['disabled'] and preg_match('/' . $config['disabled'] . '/i', $v)) {
                FileLog::instance()->antiHigh($_REQUEST);
                exit();
            }

            //如果参数名称非法
            if (isset($config['antiName']) and in_array($k, $config['antiName'])) {
                FileLog::instance()->antiName($_REQUEST);
                exit();
            }
        }
    }
递归检查一个数组中是否有禁止词
@param array $arr 要检查的数组
@param array $config 配置信息