Remove repeated hyphens
This commit is contained in:
parent
d5eec724d6
commit
9f1d781beb
2 changed files with 2 additions and 2 deletions
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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 : '-';
|
||||
|
|
Loading…
Add table
Reference in a new issue