mirror of
https://github.com/silverstripe/silverstripe-blog
synced 2024-10-22 11:05:58 +02:00
Merge pull request #685 from wilr/wilr-patch-1
Allow multibyte to be configured (fixes #605)
This commit is contained in:
commit
08e2bd38e7
@ -7,7 +7,6 @@ use SilverStripe\ORM\DataObject;
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
|
@ -181,12 +181,7 @@ trait BlogObject
|
||||
{
|
||||
$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);
|
||||
|
||||
|
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user