Merge pull request #733 from lerni/mb-again

addition to #685 also, respect mb-config in controller for tags & categories
This commit is contained in:
Will Rossiter 2023-11-21 10:49:05 +13:00 committed by GitHub
commit e6228eae37
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -11,6 +11,8 @@ use SilverStripe\ORM\DataList;
use SilverStripe\ORM\FieldType\DBDatetime;
use SilverStripe\ORM\PaginatedList;
use SilverStripe\Security\Member;
use SilverStripe\Blog\Model\BlogTag;
use SilverStripe\Blog\Model\BlogCategory;
use SilverStripe\View\Parsers\URLSegmentFilter;
use SilverStripe\Control\HTTPRequest;
@ -268,6 +270,7 @@ class BlogController extends PageController
$tag = $this->request->param('Tag');
if ($tag) {
$filter = URLSegmentFilter::create();
$filter->setAllowMultibyte(BlogTag::config()->get('allow_urlsegment_multibyte'));
// url encode unless it's multibyte (already pre-encoded in the database)
// see https://github.com/silverstripe/silverstripe-cms/pull/2384
if (!$filter->getAllowMultibyte()) {
@ -318,6 +321,7 @@ class BlogController extends PageController
$category = $this->request->param('Category');
if ($category) {
$filter = URLSegmentFilter::create();
$filter->setAllowMultibyte(BlogCategory::config()->get('allow_urlsegment_multibyte'));
// url encode unless it's multibyte (already pre-encoded in the database)
// see https://github.com/silverstripe/silverstripe-cms/pull/2384
if (!$filter->getAllowMultibyte()) {