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

Return string, not Twig_Markup object in Twig extension #615

Merged
merged 1 commit into from
Jul 2, 2015
Merged

Return string, not Twig_Markup object in Twig extension #615

merged 1 commit into from
Jul 2, 2015

Conversation

lstrojny
Copy link
Contributor

Returning a markup object breaks interoperability with the Symfony assets extension. More details here: symfony/symfony#15158

@lsmith77 lsmith77 added the State: Reviewing This item is being reviewed to determine if it should be accepted. label Jul 1, 2015
lsmith77 added a commit that referenced this pull request Jul 2, 2015
Return string, not Twig_Markup object in Twig extension
@lsmith77 lsmith77 merged commit 01fca44 into liip:master Jul 2, 2015
@lsmith77 lsmith77 removed the State: Reviewing This item is being reviewed to determine if it should be accepted. label Jul 2, 2015
@makasim
Copy link
Collaborator

makasim commented Jul 2, 2015

This is a BC break IMO. I believe it was done (wrapping to Twig_Markup) on purpose to solve the problem we had, cannot recall which one though

@lsmith77
Copy link
Contributor

lsmith77 commented Jul 2, 2015

i guess 54cfe94

@lsmith77
Copy link
Contributor

lsmith77 commented Jul 3, 2015

@stof / @Tobion ?

@makasim
Copy link
Collaborator

makasim commented Jul 5, 2015

I recall, We had double url encoding and to avoid this Twig_Markup was added.

@makasim
Copy link
Collaborator

makasim commented Jul 5, 2015

I guess I found: #314

@lstrojny
Copy link
Contributor Author

lstrojny commented Jul 6, 2015

Wouldn’t it be better to mark the function as HTML safe then?

@stof
Copy link
Contributor

stof commented Jul 15, 2015

@lstrojny avoiding autoescaping looks really weird here, because the method does not return some HTML, and it is not safe for HTML (it returns an URL, which is not safe for HTML context as & needs to be escaped in it).

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