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

html/inc/boinc_db.inc: fix $dbnum comparison in BoicDB::get() #6117

Merged
merged 1 commit into from
Feb 25, 2025

Conversation

bema-aei
Copy link
Contributor

@bema-aei bema-aei commented Feb 25, 2025

In BoicDB::get() if self::$dbnum is currently 0 or 1, it is handled as a boolean value and thus the comparison with the new $dbnum is a boolean comparison. This works for 0 or 1, but not for other values (like 2, which is also boolean true). Therefore numeric values need to be specified explicitly.

Fixes a problem in #5697 that slipped through during original review/testing. I had that in my MR (#5695), though, to fix the same problem.

- if self::$dbnum is currently 0 or 1, it as handles as a boolean value
  and thus the comparison with the new $ dbnum is a boolean comparison.
  This works for 0 or 1, but not for othe values,
  unless numeric values and comparison are specified explicitly.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 1 out of 1 changed files in this pull request and generated no comments.

@AenBleidd AenBleidd added this to the Server Release 1.6.0 milestone Feb 25, 2025
@davidpanderson davidpanderson merged commit 7225333 into BOINC:master Feb 25, 2025
153 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants