Remove repeated hyphens

This commit is contained in:
Visman 2023-11-02 19:38:59 +07:00
parent d5eec724d6
commit 9f1d781beb
2 changed files with 2 additions and 2 deletions

View file

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

View file

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