浏览代码

Remove repeated hyphens

Visman 1 年之前
父节点
当前提交
9f1d781beb
共有 2 个文件被更改,包括 2 次插入2 次删除
  1. 1 1
      app/Core/Files.php
  2. 1 1
      app/Core/Func.php

+ 1 - 1
app/Core/Files.php

@@ -976,7 +976,7 @@ class Files
             $name
             $name
         );
         );
 
 
-        $name = \trim(\preg_replace(['%[^\w-]+%', '%_+%'], ['-', '_'], $name), '-_');
+        $name = \trim(\preg_replace(['%[^\w]+%', '%_+%'], ['-', '_'], $name), '-_');
 
 
         return isset($name[0]) ? $name : (string) \time();
         return isset($name[0]) ? $name : (string) \time();
     }
     }

+ 1 - 1
app/Core/Func.php

@@ -320,7 +320,7 @@ class Func
         }
         }
 
 
         if (true === $conf['WtoHyphen']) {
         if (true === $conf['WtoHyphen']) {
-            $str = \trim(\preg_replace(['%[^\w-]+%u', '%_+%'], ['-', '_'], $str), '-_');
+            $str = \trim(\preg_replace(['%[^\w]+%u', '%_+%'], ['-', '_'], $str), '-_');
         }
         }
 
 
         return isset($str[0]) ? $str : '-';
         return isset($str[0]) ? $str : '-';