Skip to content

Commit

Permalink
Fix url that can be retrieved with <%url> tag. rel: fc2blog#211
Browse files Browse the repository at this point in the history
for single tenant mode support.
  • Loading branch information
uzulla committed Feb 11, 2021
1 parent 6fee3c5 commit 503e9c7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion app/src/Web/Controller/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -346,8 +346,13 @@ static public function preprocessingDataForFc2Template(Request $request, array $
}

// FC2用のどこでも有効な単変数
$data['url'] = '/' . $data['blog']['id'] . '/';
$data['blog_id'] = UserController::getBlogId($request); // TODO User系でしかこのメソッドは呼ばれないはずなので
if ($data['blog_id'] !== Config::get('DEFAULT_BLOG_ID')) {
$data['url'] = '/' . $data['blog']['id'] . '/';
} else {
// シングルテナントモード、DEFAULT_BLOG_IDとBlogIdが一致するなら、Pathを省略する
$data['url'] = '/';
}

// 年月日系
$data['now_date'] = (isset($data['date_area']) && $data['date_area']) ? $data['now_date'] : date('Y-m-d');
Expand Down

0 comments on commit 503e9c7

Please sign in to comment.