Skip to content

Commit

Permalink
BUG Fix support for URLSegmentFilter.default_allow_multibyte
Browse files Browse the repository at this point in the history
  • Loading branch information
Damian Mooyman committed Jun 3, 2015
1 parent 1b7c312 commit 1382eae
Showing 1 changed file with 6 additions and 20 deletions.
26 changes: 6 additions & 20 deletions code/model/Blog.php
Original file line number Diff line number Diff line change
Expand Up @@ -801,20 +801,12 @@ public function getCurrentTag() {
* @var Blog $dataRecord
*/
$dataRecord = $this->dataRecord;

// get the tag value and generate a URL Segment for it
// use the URL segment for searching
$tagvalue = $this->request->param('Tag');
if($tagvalue) {
$tempTag = new BlogTag();
$tempTag->Title = $tagvalue;
$tag = $tempTag->generateURLSegment();

$tag = $this->request->param('Tag');
if($tag) {
return $dataRecord->Tags()
->filter('URLSegment', $tag)
->filter('URLSegment', array($tag, rawurlencode($tag)))
->first();
}

return null;
}

Expand Down Expand Up @@ -847,18 +839,12 @@ public function getCurrentCategory() {
* @var Blog $dataRecord
*/
$dataRecord = $this->dataRecord;

$categoryValue = $this->request->param('Category');

if($categoryValue) {
$tempCategory = new BlogCategory();
$tempCategory->Title = $categoryValue;
$category = $tempCategory->generateURLSegment();
$category = $this->request->param('Category');
if($category) {
return $dataRecord->Categories()
->filter('URLSegment', $category)
->filter('URLSegment', array($category, rawurlencode($category)))
->first();
}

return null;
}

Expand Down

0 comments on commit 1382eae

Please sign in to comment.