Skip to content

Fix: Temporal orWhere() filtering accepts every model - #374

Merged
techmahedy merged 1 commit into
doppar:4.xfrom
techmahedy:issue-4.x
Oct 17, 2026
Merged

techmahedy merged 1 commit into
doppar:4.xfrom
techmahedy:issue-4.x

Conversation

@techmahedy

Copy link
Copy Markdown
Member

Pull Request Checklist

Q A
Branch? 4.x
Bug fix? yes
New feature? no
Deprecations? no
Issues -
License MIT

Description

applyPhpConditions() initializes $pass to true. For the first or subsequent OR condition it evaluates $pass || $result, which is always true. A temporal query such as Model::at($time)->orWhere('status', 'closed')->get() therefore returns all snapshots, including rows that do not satisfy the condition. More complex where(...)->orWhere(...) combinations also do not preserve normal SQL boolean semantics.

This PR will fix this issue.

@techmahedy
techmahedy merged commit b080f00 into doppar:4.x Oct 17, 2026
12 of 16 checks passed
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

Successfully merging this pull request may close these issues.

1 participant