Commit 3fd7f0ad authored by 박관영's avatar 박관영

Fix for Issue #455

parent a96dec08
...@@ -54,3 +54,24 @@ if (! function_exists('asgard_editor')) { ...@@ -54,3 +54,24 @@ if (! function_exists('asgard_editor')) {
return view('core::components.textarea-wrapper', compact('fieldName', 'labelName', 'content')); return view('core::components.textarea-wrapper', compact('fieldName', 'labelName', 'content'));
} }
} }
if (! function_exists('utf8_slug')) {
function utf8_slug($title, $separator = '-')
{
// Convert all dashes/underscores into separator
$flip = $separator == '-' ? '_' : '-';
$title = preg_replace('!['.preg_quote($flip).']+!u', $separator, $title);
// Replace @ with the word 'at'
$title = str_replace('@', $separator.'at'.$separator, $title);
// Remove all characters that are not the separator, letters, numbers, or whitespace.
$title = preg_replace('![^'.preg_quote($separator).'\pL\pN\s]+!u', '', mb_strtolower($title));
// Replace all separator characters and whitespace by a single separator
$title = preg_replace('!['.preg_quote($separator).'\s]+!u', $separator, $title);
return trim($title, $separator);
}
}
...@@ -206,6 +206,6 @@ trait TaggableTrait ...@@ -206,6 +206,6 @@ trait TaggableTrait
*/ */
protected function generateTagSlug($name) protected function generateTagSlug($name)
{ {
return str_slug($name); return utf8_slug($name);
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment