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

FIX Make sure `setAllowMultibyte` is on when looking up by URLSegment
This commit is contained in:
Robbie Averill 2018-06-20 08:24:01 +12:00 committed by GitHub
commit a4efb3409c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View File

@ -709,6 +709,7 @@ class Blog_Controller extends Page_Controller
if ($urlSegment) { if ($urlSegment) {
$filter = URLSegmentFilter::create(); $filter = URLSegmentFilter::create();
$filter->setAllowMultibyte(true);
return Member::get() return Member::get()
->filter('URLSegment', $filter->filter($urlSegment)) ->filter('URLSegment', $filter->filter($urlSegment))

View File

@ -53,8 +53,10 @@ class BlogArchiveWidgetTest extends SapphireTest
array('Title' => 'August 2017'), array('Title' => 'August 2017'),
), $archive); ), $archive);
if ($original) {
Versioned::reading_stage($original); Versioned::reading_stage($original);
} }
}
public function testArchiveYearly() public function testArchiveYearly()
{ {
@ -91,6 +93,8 @@ class BlogArchiveWidgetTest extends SapphireTest
$this->assertCount(4, $archive, 'Four months are shown in the blog archive list after new post added'); $this->assertCount(4, $archive, 'Four months are shown in the blog archive list after new post added');
if ($original) {
Versioned::reading_stage($original); Versioned::reading_stage($original);
} }
}
} }