]> BookStack Code Mirror - bookstack/commitdiff
Russian slug and Multibyte String 582/head
authorVladimir <redacted>
Fri, 3 Nov 2017 12:00:07 +0000 (14:00 +0200)
committerGitHub <redacted>
Fri, 3 Nov 2017 12:00:07 +0000 (14:00 +0200)
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;