fix: address code review feedback (DB filename, migration query, error handling)

Co-authored-by: naielv <109038805+naielv@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-03-06 22:02:32 +00:00
parent 0c362fd40b
commit 6aaee59b3d
4 changed files with 12 additions and 8 deletions

View File

@@ -63,8 +63,9 @@ if (is_dir($users_dir)) {
$user_id = (int) $db->lastInsertId();
if ($user_id === 0) {
// Already existed look it up
$row = $db->prepare("SELECT id FROM users WHERE username = ?")->execute([$username]);
$user_id = (int) $db->query("SELECT id FROM users WHERE username = " . $db->quote($username))->fetchColumn();
$stmt2 = $db->prepare("SELECT id FROM users WHERE username = ?");
$stmt2->execute([$username]);
$user_id = (int) $stmt2->fetchColumn();
}
// Entreaulas centro assignment