Skip to content

Commit be99814

Browse files
committed
コードの変更を記述するための短く簡潔なコミットメッセージを提案します。***
***コミットメッセージは、以下のロケールに翻訳される必要があります: ja
1 parent 63838ea commit be99814

5 files changed

Lines changed: 17 additions & 17 deletions

File tree

dashboard.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@
118118
</div>
119119
<script>
120120
function redirectToIndex() {
121-
window.location.href = 'index.php';
121+
window.location.href = '/';
122122
}
123123

124124
</script>
@@ -132,7 +132,7 @@ function redirectToIndex() {
132132
<?php endif; ?>
133133
<script>
134134
function redirectToIndex() {
135-
window.location.href = 'index.php';
135+
window.location.href = '/';
136136
}
137137

138138
let chart;
@@ -200,9 +200,9 @@ function updateChart(period) {
200200
});
201201

202202

203-
// index.phpにリダイレクトする urlない時
203+
// /にリダイレクトする urlない時
204204
function redirectToIndex() {
205-
window.location.href = 'index.php';
205+
window.location.href = '/';
206206
}
207207
</script>
208208
</body>

index.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@
2828
// カスタムパスがユニコードエスケープされた文字列である場合はエラーメッセージを出力して終了
2929
if (preg_match('/\\\\u([a-fA-F0-9]{4})/', $customPath)) {
3030
$_SESSION['error'] = "エラー: ユニコードエスケープされた文字はカスタムパスで設定できません。";
31-
header("Location: index.php");
31+
header("Location: /");
3232
exit;
3333
}
3434

3535
// カスタムパスが 'dashboard' または 'login' の場合はエラーメッセージを出力して終了
3636
if ($customPath == 'dashboard' || $customPath == 'login') {
3737
$_SESSION['error'] = "エラー: 'dashboard' または 'login' はカスタムパスとして使用できません。";
38-
header("Location: index.php");
38+
header("Location: /");
3939
exit;
4040
}
4141

@@ -48,7 +48,7 @@
4848

4949
if ($checkCustomPathResult->num_rows > 0) {
5050
$_SESSION['error'] = "エラー: そのカスタムパスは既に存在します。";
51-
header("Location: index.php");
51+
header("Location: /");
5252
exit;
5353
} else {
5454
// カスタムパスをshort_urlとしてデータベースに保存
@@ -59,7 +59,7 @@
5959
$shortUrlMessage = $_SERVER['HTTP_HOST'] . "/" . $customPath;
6060
$_SESSION['flash_message'] = "短縮URLの生成が完了しました。";
6161
$_SESSION['shortUrlMessage'] = $shortUrlMessage;
62-
header("Location: index.php"); // リダイレクトを追加
62+
header("Location: /"); // リダイレクトを追加
6363
exit;
6464
} else {
6565
echo "SQLエラー: " . $insertStmt->error; // SQLエラーを出力
@@ -83,7 +83,7 @@
8383

8484
if ($checkResult->num_rows > 0) {
8585
$_SESSION['error'] = "エラー: その短縮URLは既に存在します。";
86-
header("Location: index.php");
86+
header("Location: /");
8787
exit;
8888
} else {
8989
$sql = "INSERT INTO short_urls (short_url, original_url, user_id) VALUES (?, ?, ?)";
@@ -94,12 +94,12 @@
9494
$shortUrlMessage = $_SERVER['HTTP_HOST'] . "/" . $shortUrl;
9595
$_SESSION['flash_message'] = "短縮URLの生成が完了しました。";
9696
$_SESSION['shortUrlMessage'] = $shortUrlMessage;
97-
header("Location: index.php"); // リダイレクトを追加
97+
header("Location: /"); // リダイレクトを追加
9898
exit;
9999
} else {
100100
$shortUrlMessage = "エラー: " . $sql . "<br>" . $conn->error;
101101
$_SESSION['error'] = $shortUrlMessage;
102-
header("Location: index.php"); // リダイレクトを追加
102+
header("Location: /"); // リダイレクトを追加
103103
exit;
104104
}
105105
}
@@ -227,7 +227,7 @@
227227
navigator.clipboard.writeText(text).then(function() {
228228
document.getElementById('copyMessage').textContent = 'コピーされました';
229229
$_SESSION['flash_message'] = "コピーしました。";
230-
header("Location: index.php");
230+
header("Location: /");
231231
exit;
232232
}, function(err) {
233233
console.error('Could not copy text: ', err);

logout.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
session_destroy();
44
session_start();
55
$_SESSION["flash_message"] = "ログアウトが完了しました。";
6-
header("Location: index.php");
6+
header("Location: /");
77
exit;
88
?>

setup-kari.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@
102102
// 自身のファイルを削除する
103103
unlink(__FILE__);
104104
$_SESSION['flash_message'] = 'データベースの設定が成功しました。';
105-
// 設定が完了したらindex.phpにリダイレクト
106-
header('Location: index.php');
105+
// 設定が完了したら/にリダイレクト
106+
header('Location: /');
107107
exit;
108108

109109
}

urlsx.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ document.getElementById('login-form').addEventListener('submit', function(event)
3737
})
3838
.then(response => response.text())
3939
.then(data => {
40-
if (data.includes('Location: index.php')) {
41-
window.location.href = 'index.php';
40+
if (data.includes('Location: /')) {
41+
window.location.href = '/';
4242
} else {
4343
alert('ログインに失敗しました。');
4444
}

0 commit comments

Comments
 (0)