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

[10.x] Fixes whereDate, whereDay, whereMonth, whereTime, whereYear and whereJsonLength to ignore invalid $operator #52704

Merged
merged 8 commits into from
Sep 9, 2024

Conversation

crynobone
Copy link
Member

No description provided.

… and `whereJsonLength` to ignore invalid `$operator`

Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>
Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>
Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>
Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>
Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>
Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>
Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>
Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>
@crynobone crynobone changed the title Fixes whereDate, whereDay, whereMonth, whereTime, whereYear and whereJsonLength to ignore invalid $operator [10.x] Fixes whereDate, whereDay, whereMonth, whereTime, whereYear and whereJsonLength to ignore invalid $operator Sep 9, 2024
@@ -33,13 +36,16 @@ public function getSQLDeclaration(array $column, AbstractPlatform $platform): st
MySQLPlatform::class,
MySQL57Platform::class,
MySQL80Platform::class,
MySQL84Platform::class,
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't we move these changes to a separate PR?

Copy link
Member Author

Choose a reason for hiding this comment

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

10.x is currently on security only updates.

@rodrigopedra
Copy link
Contributor

Mind if I ask why? Or what is this trying to solve?

Isn't it better to throw an InvalidArgumentException?

I mean, if a particular DBMS supports an operator not listed as valid within the class, I guess the developer would be surprised by this behavior.

@GrahamCampbell
Copy link
Member

Mind if I ask why? Or what is this trying to solve?

I assume the issue is SQL injection, where the operator comes from user input? We have a similar fallback system for when an invalid sort direction is passed to order by, for example.

@taylorotwell taylorotwell merged commit 80cdd87 into 10.x Sep 9, 2024
23 of 25 checks passed
@taylorotwell taylorotwell deleted the where-invalid-operator branch September 9, 2024 13:54
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.

4 participants