mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-07-28 17:02:04 +03:00
Added test to cover multi-byte slugs
Also removed check for 'mb_' functions since mbstring is a dependancy
This commit is contained in:
@ -553,7 +553,7 @@ class EntityRepo
|
||||
*/
|
||||
protected function nameToSlug($name)
|
||||
{
|
||||
$slug = str_replace(' ', '-', function_exists('mb_strtolower') ? mb_strtolower($name) : strtolower($name));
|
||||
$slug = str_replace(' ', '-', mb_strtolower($name));
|
||||
$slug = preg_replace('/[\+\/\\\?\@\}\{\.\,\=\[\]\#\&\!\*\'\;\:\$\%]/', '', $slug);
|
||||
if ($slug === "") $slug = substr(md5(rand(1, 500)), 0, 5);
|
||||
return $slug;
|
||||
|
Reference in New Issue
Block a user