]> BookStack Code Mirror - bookstack/blobdiff - app/Repos/EntityRepo.php
Russian slug and Multibyte String
[bookstack] / app / Repos / EntityRepo.php
index 95ae2ed0e78673c73fbe19856fb923dcadf582cd..25d229be13512ec055ce40fd586f5c35b19f1a0c 100644 (file)
@@ -553,7 +553,7 @@ class EntityRepo
      */
     protected function nameToSlug($name)
     {
-        $slug = str_replace(' ', '-', strtolower($name));
+        $slug = str_replace(' ', '-', function_exists('mb_strtolower') ? mb_strtolower($name) : strtolower($name));
         $slug = preg_replace('/[\+\/\\\?\@\}\{\.\,\=\[\]\#\&\!\*\'\;\:\$\%]/', '', $slug);
         if ($slug === "") $slug = substr(md5(rand(1, 500)), 0, 5);
         return $slug;