瀏覽代碼

过滤正则匹配问题修复

magicblack 4 年之前
父節點
當前提交
8f6c6f3032
共有 1 個文件被更改,包括 13 次插入1 次删除
  1. 13 1
      application/common.php

+ 13 - 1
application/common.php

@@ -142,7 +142,19 @@ function mac_compress_html($s){
 
 function mac_build_regx($regstr,$regopt)
 {
-    return '/'.str_replace('/','\/',$regstr).'/'.$regopt;
+    return '/'.str_replace([
+        '/',
+        '$',
+        '+',
+        '-',
+        '{',
+    ],[
+        '\/',
+        '\$',
+        '\+',
+        '\-',
+        '\{',
+    ],$regstr).'/'.$regopt;
 }
 
 function mac_reg_replace($str,$rule,$value)