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

Support nested quotes #651

Merged
merged 4 commits into from
May 16, 2024
Merged

Support nested quotes #651

merged 4 commits into from
May 16, 2024

Conversation

b-viguier
Copy link
Contributor

@b-viguier b-viguier commented May 16, 2024

Hi 👋 🙂

I encountered an edge case with the Regex currently used to parse placeholders.

payload ->> '$."value-1"' = :value1
OR
payload ->> '$."value-2"' = :value2

ℹ️ " are needed here to escape the - special character in the field's name

The problem with the current (["\'])([^"\']*\1) regex is that it tries to exclude ' AND " in the middle of a string. If this is a simply quoted string we should exclude only simple quotes.

I found a way to negate a backreference in stackoverflow.

Unfortunately, I totally failed to run tests locally, so I didn't add corresponding test... but I would love to if you have some helping instructions
[Edit] it seems that locally I got the same errors encountered by the CI, so maybe the issue is not related to my local setup but to master branch...
[Edit 2 ] tests added 🎉

Thanks for you work 🙏

@staabm
Copy link
Owner

staabm commented May 16, 2024

Just fixed the master build with #652

please try again while making sure you are running the tests with doctrine/dbal:^3 like I did in above PR

@b-viguier b-viguier marked this pull request as ready for review May 16, 2024 16:07
@b-viguier
Copy link
Contributor Author

Thanks @staabm ! Tests added 👍
I was confused by cache files, but as far as I understand they are expected to be updated, so I included them (not sure if all cache files are up to date)

@staabm staabm merged commit 7079671 into staabm:main May 16, 2024
31 checks passed
@staabm
Copy link
Owner

staabm commented May 16, 2024

Thank you!

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.

2 participants