Bugfix return value instead of null to check for existence

This commit is contained in:
danwin1210 committed 2026-10-25 15:45:32 +01:00
1 parent e8b44ac1a9
commit 241b8d48fc
1 file changed
+1 -1
+1 -1
View File
@@ -32,7 +32,7 @@ if ( isset( $_POST[ 'user' ] ) ) {
$ok = false;
$msg .= '<div class="red" role="alert">'.htmlspecialchars(_('A valid invite code is required.')).'</div>';
} else {
$stmt = $db->prepare( 'SELECT null FROM invite_codes WHERE code = ? AND redeemed_by IS NULL;' );
$stmt = $db->prepare( 'SELECT code FROM invite_codes WHERE code = ? AND redeemed_by IS NULL;' );
$stmt->execute( [ $invite_code ] );
if ( ! $stmt->fetchColumn() ) {
$ok = false;