mirror of
https://github.com/silverstripe/silverstripe-blog
synced 2024-10-22 11:05:58 +02:00
FIX: Allow multibyte to be configured (#605)
This commit is contained in:
parent
c05f704a34
commit
99d1063361
@ -7,7 +7,6 @@ use SilverStripe\ORM\DataObject;
|
|||||||
/**
|
/**
|
||||||
* A blog category for generalising blog posts.
|
* A blog category for generalising blog posts.
|
||||||
*
|
*
|
||||||
*
|
|
||||||
* @method Blog Blog()
|
* @method Blog Blog()
|
||||||
*
|
*
|
||||||
* @property string $Title
|
* @property string $Title
|
||||||
@ -33,6 +32,8 @@ class BlogCategory extends DataObject implements CategorisationObject
|
|||||||
*/
|
*/
|
||||||
private static $table_name = 'BlogCategory';
|
private static $table_name = 'BlogCategory';
|
||||||
|
|
||||||
|
private static bool $allow_urlsegment_multibyte = true;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
|
@ -181,12 +181,7 @@ trait BlogObject
|
|||||||
{
|
{
|
||||||
$increment = (int) $increment;
|
$increment = (int) $increment;
|
||||||
$filter = URLSegmentFilter::create();
|
$filter = URLSegmentFilter::create();
|
||||||
|
$filter->setAllowMultibyte($this->config()->get('allow_urlsegment_multibyte') ?? true);
|
||||||
// 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);
|
|
||||||
|
|
||||||
$this->URLSegment = $filter->filter($this->Title);
|
$this->URLSegment = $filter->filter($this->Title);
|
||||||
|
|
||||||
|
@ -18,6 +18,8 @@ class BlogTag extends DataObject implements CategorisationObject
|
|||||||
{
|
{
|
||||||
use BlogObject;
|
use BlogObject;
|
||||||
|
|
||||||
|
private static bool $allow_urlsegment_multibyte = true;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Use an exception code so that attempted writes can continue on
|
* Use an exception code so that attempted writes can continue on
|
||||||
* duplicate errors.
|
* duplicate errors.
|
||||||
|
Loading…
Reference in New Issue
Block a user