mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-05-31 04:55:50 +08:00
Enabled utf8 slugs
Prevents slug change when using only non-ascii chars Allows use of more localised urls. Closes #233
This commit is contained in:
@ -150,8 +150,7 @@ class ChapterRepo extends EntityRepo
|
||||
*/
|
||||
public function findSuitableSlug($name, $bookId, $currentId = false)
|
||||
{
|
||||
$slug = Str::slug($name);
|
||||
if ($slug === "") $slug = substr(md5(rand(1, 500)), 0, 5);
|
||||
$slug = $this->nameToSlug($name);
|
||||
while ($this->doesSlugExist($slug, $bookId, $currentId)) {
|
||||
$slug .= '-' . substr(md5(rand(1, 500)), 0, 3);
|
||||
}
|
||||
|
Reference in New Issue
Block a user