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

[5.3] Fix View compilation bug #16506

Merged
merged 2 commits into from
Nov 23, 2016
Merged

[5.3] Fix View compilation bug #16506

merged 2 commits into from
Nov 23, 2016

Conversation

manan-jadhav
Copy link
Contributor

@manan-jadhav manan-jadhav commented Nov 22, 2016

Having {{$var['a or b']}} would generate wrong code, since the key ('a or b') contains 'or' and this or was understood as the 'or' shortcut.

Fixed the issue by improving the regex used for detecting the 'or' shortcut.

… key compiled wrongly

$var['thor'] would generate wrong code, since the key thor contains 'or' and this or was understood as the 'or' shortcut
@GrahamCampbell GrahamCampbell changed the title [Bug] Fix View compilation bug, where using arrays with 'or' as a part of a key compiled wrongly [5.3] Fix View compilation bug Nov 22, 2016
@taylorotwell
Copy link
Member

What about situations like: {{ thorson() }} ... does that cause problems?

@manan-jadhav
Copy link
Contributor Author

manan-jadhav commented Nov 23, 2016

Sorry, I made a mistake in describing the problem, {{$var['thor']}} wont be a problem,
but {{$var['a or b']}} will be. Basically, having 'or' with spaces around it, like in 'a or b' will cause problems. Situations like {{thorson()}} wont be a problem since the 'or' it contains does not having spaces surrounding it. And also, there needs to be a leading '$' sign as well, which {{thorson()}} does not have.

@taylorotwell taylorotwell merged commit eb13ee9 into laravel:5.3 Nov 23, 2016
@browner12
Copy link
Contributor

TIL you can have spaces in your array key.

@manan-jadhav
Copy link
Contributor Author

@taylorotwell should this go to 5.1 branch as well?

@fernandobandeira
Copy link
Contributor

This broke things, check #16593 ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants