diff --git a/src/Model/BlogCategory.php b/src/Model/BlogCategory.php index ae69c7de..5734b1db 100644 --- a/src/Model/BlogCategory.php +++ b/src/Model/BlogCategory.php @@ -7,7 +7,6 @@ /** * A blog category for generalising blog posts. * -* * @method Blog Blog() * * @property string $Title @@ -33,6 +32,8 @@ class BlogCategory extends DataObject implements CategorisationObject */ private static $table_name = 'BlogCategory'; + private static bool $allow_urlsegment_multibyte = true; + /** * @var array */ diff --git a/src/Model/BlogObject.php b/src/Model/BlogObject.php index d067fb39..af53dc8f 100644 --- a/src/Model/BlogObject.php +++ b/src/Model/BlogObject.php @@ -181,12 +181,7 @@ public function generateURLSegment($increment = 0) { $increment = (int) $increment; $filter = URLSegmentFilter::create(); - - // Setting this to on. Because of the UI flow, it would be quite a lot of work - // to support turning this off. (ie. the add by title flow would not work). - // If this becomes a problem we can approach it then. - // @see https://github.com/silverstripe/silverstripe-blog/issues/376 - $filter->setAllowMultibyte(true); + $filter->setAllowMultibyte($this->config()->get('allow_urlsegment_multibyte') ?? true); $this->URLSegment = $filter->filter($this->Title); diff --git a/src/Model/BlogTag.php b/src/Model/BlogTag.php index 4180f67d..9735493f 100644 --- a/src/Model/BlogTag.php +++ b/src/Model/BlogTag.php @@ -18,6 +18,8 @@ class BlogTag extends DataObject implements CategorisationObject { use BlogObject; + private static bool $allow_urlsegment_multibyte = true; + /** * Use an exception code so that attempted writes can continue on * duplicate errors.