diff --git a/lib/Baser/Plugin/Blog/Test/Case/View/Helper/BlogHelperTest.php b/lib/Baser/Plugin/Blog/Test/Case/View/Helper/BlogHelperTest.php
index aa5c44b342..6ad90e2c91 100644
--- a/lib/Baser/Plugin/Blog/Test/Case/View/Helper/BlogHelperTest.php
+++ b/lib/Baser/Plugin/Blog/Test/Case/View/Helper/BlogHelperTest.php
@@ -804,10 +804,10 @@ public function testTagList($expected, $name, $options = [])
public function tagListDataProvider()
{
return [
- ['/(?=\/tag\/タグ1).*?(?!.*\/tag\/タグ2).*?(?!.*\/tag\/タグ3)/s', 'blog1'],
- ['/(?=\/tag\/タグ1).*?(?=\/tag\/タグ2).*?(?=\/tag\/タグ3)/s', '/s/blog3/'],
- ['/(?=\/tags\/タグ1).*?(?=\/tags\/タグ2).*?(?=\/tags\/タグ3).*?(?=\/tags\/タグ4).*?(?=\/tags\/タグ5)/s', null],
- ['/(?=\/tag\/タグ1).*?\(2\)/s', 'blog1', ['postCount' => true]],
+ ['/(?=\/tag\/%E3%82%BF%E3%82%B0%EF%BC%91).*?(?!.*\/tag\/%E3%82%BF%E3%82%B0%EF%BC%92).*?(?!.*\/tag\/%E3%82%BF%E3%82%B0%EF%BC%93)/s', 'blog1'],
+ ['/(?=\/tag\/%E3%82%BF%E3%82%B0%EF%BC%91).*?(?=\/tag\/%E3%82%BF%E3%82%B0%EF%BC%92).*?(?=\/tag\/%E3%82%BF%E3%82%B0%EF%BC%93)/s', '/s/blog3/'],
+ ['/(?=\/tags\/%E3%82%BF%E3%82%B0%EF%BC%91).*?(?=\/tags\/%E3%82%BF%E3%82%B0%EF%BC%92).*?(?=\/tags\/%E3%82%BF%E3%82%B0%EF%BC%93).*?(?=\/tags\/%E3%82%BF%E3%82%B0%EF%BC%94).*?(?=\/tags\/%E3%82%BF%E3%82%B0%EF%BC%95)/s', null],
+ ['/(?=\/tag\/%E3%82%BF%E3%82%B0%EF%BC%91).*?\(2\)/s', 'blog1', ['postCount' => true]],
];
}
@@ -836,13 +836,13 @@ public function testGetTagLinkUrl($currentUrl, $blogContentId, $name, $base, $us
public function getTagLinkUrlDataProvider()
{
return [
- ['/', 1, 'タグ1', '', false, '/news/archives/tag/タグ1'],
- ['/', 1, 'タグ1', '/sub', false, '/news/archives/tag/タグ1'],
- ['/', 1, 'タグ1', '/sub', true, '/sub/news/archives/tag/タグ1'],
- ['/en/', 3, 'タグ2', '', false, '/en/news/archives/tag/タグ2'],
- ['/', 4, 'タグ2', '', false, 'http://sub.main.com/news/archives/tag/タグ2'],
- ['/', null, 'タグ1', '', false, '/tags/タグ1'],
- ['/s/', null, 'タグ2', '', false, '/s/tags/タグ2']
+ ['/', 1, 'タグ1', '', false, '/news/archives/tag/%E3%82%BF%E3%82%B0%EF%BC%91'],
+ ['/', 1, 'タグ1', '/sub', false, '/news/archives/tag/%E3%82%BF%E3%82%B0%EF%BC%91'],
+ ['/', 1, 'タグ1', '/sub', true, '/sub/news/archives/tag/%E3%82%BF%E3%82%B0%EF%BC%91'],
+ ['/en/', 3, 'タグ2', '', false, '/en/news/archives/tag/%E3%82%BF%E3%82%B0%EF%BC%92'],
+ ['/', 4, 'タグ2', '', false, 'http://sub.main.com/news/archives/tag/%E3%82%BF%E3%82%B0%EF%BC%92'],
+ ['/', null, 'タグ1', '', false, '/tags/%E3%82%BF%E3%82%B0%EF%BC%91'],
+ ['/s/', null, 'タグ2', '', false, '/s/tags/%E3%82%BF%E3%82%B0%EF%BC%92']
];
}
@@ -871,10 +871,10 @@ public function testGetTagLink($expected, $currentUrl, $blogContentId, $name)
public function getTagLinkDataProvider()
{
return [
- ['タグ1', '/', 1, 'タグ1'],
- ['タグ2', '/s/', 3, 'タグ2'],
- ['タグ1', '/', null, 'タグ1'],
- ['タグ2', '/s/', null, 'タグ2']
+ ['タグ1', '/', 1, 'タグ1'],
+ ['タグ2', '/s/', 3, 'タグ2'],
+ ['タグ1', '/', null, 'タグ1'],
+ ['タグ2', '/s/', null, 'タグ2']
];
}
diff --git a/lib/Baser/Plugin/Blog/View/Helper/BlogHelper.php b/lib/Baser/Plugin/Blog/View/Helper/BlogHelper.php
index 05b5ab4323..90124a813e 100755
--- a/lib/Baser/Plugin/Blog/View/Helper/BlogHelper.php
+++ b/lib/Baser/Plugin/Blog/View/Helper/BlogHelper.php
@@ -1452,11 +1452,11 @@ public function getTagLinkUrl($blogContentId, $tag, $base = true)
if (!empty($this->content['url'])) {
$site = BcSite::findByUrl($this->content['url']);
$url = $this->BcBaser->getContentsUrl($this->content['url'], !$this->isSameSiteBlogContent($blogContentId), !empty($site->useSubDomain), false);
- $url = $url . 'archives/tag/' . $tag['name'];
+ $url = $url . 'archives/tag/' . rawurlencode($tag['name']);
}
}
if (!$url) {
- $url = '/tags/' . $tag['name'];
+ $url = '/tags/' . rawurlencode($tag['name']);
$site = BcSite::findCurrent(true);
if ($site && $site->alias && !$site->useSubDomain) {
$url = '/' . $site->alias . $url;