]> BookStack Code Mirror - bookstack/blobdiff - app/Repos/PageRepo.php
Enabled utf8 slugs
[bookstack] / app / Repos / PageRepo.php
index 72a310ad2a4224189b282810e8a46f866bfd71e3..e6d713f77c591f3451c38ff777d5060974946292 100644 (file)
@@ -614,8 +614,7 @@ class PageRepo 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);
         }