Skip to content

Commit

Permalink
change link for login in footer fc2blog#269
Browse files Browse the repository at this point in the history
  • Loading branch information
uzulla committed Apr 16, 2021
1 parent 1ee648c commit b7a4a26
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 9 deletions.
3 changes: 2 additions & 1 deletion app/src/Web/Html.php
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,9 @@ public static function input(Request $request, $name, $type, $attrs = array(), $

public static function getServerUrl(Request $request): string
{
$url = (isset($request->server["HTTPS"]) && $request->server["HTTPS"] === "on") ? 'http://' : 'https://';
$url = $request->isHttps() ? 'https://' : 'http://';
$url .= Config::get('DOMAIN');
$url .= $request->isHttps() ? Config::get('HTTPS_PORT_STR') : Config::get('HTTP_PORT_STR');
return $url;
}
}
Expand Down
5 changes: 5 additions & 0 deletions app/src/Web/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -434,4 +434,9 @@ public function getBlogId(): ?string
return null;
}
}

public function isHttps(): bool
{
return isset($this->server["HTTPS"]) && $this->server["HTTPS"] === "on";
}
}
2 changes: 1 addition & 1 deletion app/templates/default/fc2_default_template_sp.php
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ function submit(){
<div id="footer">
<div class="footer_menu">
<a href="<%server_url><%blog_id>/admin.php"><%template_login></a>
<a href="<%server_url>admin/"><%template_login></a>
<a href="mailto:@?subject=FC2%E3%83%96%E3%83%AD%E3%82%B0&body=<%url>"><%template_tell_friend></a>
</div>
<p class="copyright">Copyright (c) <%blog_name></p>
Expand Down
2 changes: 1 addition & 1 deletion app/templates/skeleton/fc2_skeleton_template_sp.php
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@
<ul>
<li><a href="<%url>">ホーム</a></li>
<li><a href="#header">ページトップ</a></li>
<li><a href="<%server_url><%blog_id>/admin.php">ログイン</a></li>
<li><a href="<%server_url>admin/">ログイン</a></li>
</ul>
</body>
Expand Down
12 changes: 6 additions & 6 deletions tests/test_fixture.sql

Large diffs are not rendered by default.

0 comments on commit b7a4a26

Please sign in to comment.