Merge pull request #541 from dhensby/pulls/2.4/fix-multibyte-urlfilter

FIX Make sure all URL filters allow multibyte
This commit is contained in:
Dylan Wagstaff 2018-06-25 13:15:09 +12:00 committed by GitHub
commit 3ed161744b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 0 deletions

View File

@ -57,6 +57,8 @@ class BlogMemberExtension extends DataExtension
public function generateURLSegment() public function generateURLSegment()
{ {
$filter = URLSegmentFilter::create(); $filter = URLSegmentFilter::create();
$filter->setAllowMultibyte(true);
$name = $this->owner->FirstName . ' ' . $this->owner->Surname; $name = $this->owner->FirstName . ' ' . $this->owner->Surname;
$urlSegment = $filter->filter($name); $urlSegment = $filter->filter($name);

View File

@ -864,6 +864,7 @@ class Blog_Controller extends Page_Controller
$tag = $this->request->param('Tag'); $tag = $this->request->param('Tag');
if ($tag) { if ($tag) {
$filter = URLSegmentFilter::create(); $filter = URLSegmentFilter::create();
$filter->setAllowMultibyte(true);
return $dataRecord->Tags() return $dataRecord->Tags()
->filter('URLSegment', array($tag, $filter->filter($tag))) ->filter('URLSegment', array($tag, $filter->filter($tag)))
@ -910,6 +911,7 @@ class Blog_Controller extends Page_Controller
$category = $this->request->param('Category'); $category = $this->request->param('Category');
if ($category) { if ($category) {
$filter = URLSegmentFilter::create(); $filter = URLSegmentFilter::create();
$filter->setAllowMultibyte(true);
return $dataRecord->Categories() return $dataRecord->Categories()
->filter('URLSegment', array($category, $filter->filter($category))) ->filter('URLSegment', array($category, $filter->filter($category)))