Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue: Typo in check_any_debtors function causing potential bug #23

Open
dailypush opened this issue Apr 30, 2023 · 0 comments
Open

Issue: Typo in check_any_debtors function causing potential bug #23

dailypush opened this issue Apr 30, 2023 · 0 comments

Comments

@dailypush
Copy link

dailypush commented Apr 30, 2023

Typo in check_any_debtors function causing potential bug

I noticed a small issue in the check_any_debtors function in people.php which might cause unexpected behavior.

function check_any_debtors($emails) {
    global $db;
    $get = $db->prepare('SELECT count(*) FROM debtors WHERE email=? AND owner=?');
    foreach($emails as $email) {
        $get->execute(array($email, $_SESSION['tabby_loggedin']));
        if($get->fetchColumn() > 0) {
            return FALSE;
        }
    }
    return T;
}

In the last line of the function, it should return TRUE instead of T. The current implementation might lead to a runtime error or unexpected behavior since T is not a defined constant in the code.

Proposed solution:

Replace return T; with return TRUE; to fix the issue:

function check_any_debtors($emails) {
    // ...
    return TRUE;
}

Please let me know if you have any questions or need further clarification.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant