mirror of
https://github.com/silverstripe/silverstripe-blog
synced 2024-10-22 11:05:58 +02:00
Merge pull request #263 from tractorcow/pulls/fix-urlencoded-tags
Fix support for URLSegmentFilter.default_allow_multibyte
This commit is contained in:
commit
8b082e013f
@ -801,20 +801,12 @@ class Blog_Controller extends Page_Controller {
|
|||||||
* @var Blog $dataRecord
|
* @var Blog $dataRecord
|
||||||
*/
|
*/
|
||||||
$dataRecord = $this->dataRecord;
|
$dataRecord = $this->dataRecord;
|
||||||
|
$tag = $this->request->param('Tag');
|
||||||
// get the tag value and generate a URL Segment for it
|
if($tag) {
|
||||||
// use the URL segment for searching
|
|
||||||
$tagvalue = $this->request->param('Tag');
|
|
||||||
if($tagvalue) {
|
|
||||||
$tempTag = new BlogTag();
|
|
||||||
$tempTag->Title = $tagvalue;
|
|
||||||
$tag = $tempTag->generateURLSegment();
|
|
||||||
|
|
||||||
return $dataRecord->Tags()
|
return $dataRecord->Tags()
|
||||||
->filter('URLSegment', $tag)
|
->filter('URLSegment', array($tag, rawurlencode($tag)))
|
||||||
->first();
|
->first();
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -847,18 +839,12 @@ class Blog_Controller extends Page_Controller {
|
|||||||
* @var Blog $dataRecord
|
* @var Blog $dataRecord
|
||||||
*/
|
*/
|
||||||
$dataRecord = $this->dataRecord;
|
$dataRecord = $this->dataRecord;
|
||||||
|
$category = $this->request->param('Category');
|
||||||
$categoryValue = $this->request->param('Category');
|
if($category) {
|
||||||
|
|
||||||
if($categoryValue) {
|
|
||||||
$tempCategory = new BlogCategory();
|
|
||||||
$tempCategory->Title = $categoryValue;
|
|
||||||
$category = $tempCategory->generateURLSegment();
|
|
||||||
return $dataRecord->Categories()
|
return $dataRecord->Categories()
|
||||||
->filter('URLSegment', $category)
|
->filter('URLSegment', array($category, rawurlencode($category)))
|
||||||
->first();
|
->first();
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user