]> BookStack Code Mirror - bookstack/blobdiff - app/Repos/EntityRepo.php
Added test to cover multi-byte slugs
[bookstack] / app / Repos / EntityRepo.php
index 25d229be13512ec055ce40fd586f5c35b19f1a0c..944c0bcfc2c9b71fdcc71c1920c601c92d911c33 100644 (file)
@@ -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;