-
Notifications
You must be signed in to change notification settings - Fork 11.1k
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
[8.x] Fix blade compiler regex issue #36843
Conversation
I'm scared but we'll give it a shot. 😅 |
Agreed. The idea is to handle any quoted strings separately. This is a bit naive to all the various ways one may quote strings in PHP. But it should solve the immediate issue with the current Regex approach. Supporting more complex syntax will likely require a more complex approach. |
https://regexr.com/5psod Too many regex syntax errors. |
@selcukcukur PHP uses PCRE - https://regexr.com/5pspt |
@jasonmccreary I skipped that part, sorry 😅 |
Hi @driesvints, this PR caused an exception for the following case:
The new regex seems to have issues with escaping (escaped apostrophe |
@shaffe-fr, it's currently a rather naive check for quoted strings. I'll see if I can adjust it to account for basic escaping. But I do worry we're pushing the limits of what this regex can do in a single pass. |
@shaffe-fr just do |
I understand that I can do this differently, I just wanted to indicate a small regression. Sorry for the inconvenience. |
@shaffe-fr thanks for notifying us. For now please use Taylor's suggestion. |
The last PR pushes the boundaries very much, I think this should not be applied. |
Draft PR with failing test for a current issue with Blade components where a single
)
is passed as a string argument. I've tracked it down to the regex below that doesn't seems to quite parse things correctly. Every attempt I made so far to fix it broke something else in the compiler.framework/src/Illuminate/View/Compilers/BladeCompiler.php
Line 420 in d8a53a0
Update: thanks to @jasonmccreary for fixing this 🥳
Fixes #36815