-
Notifications
You must be signed in to change notification settings - Fork 715
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
throwing some sort of compile error if using a modifier where it won't work #526
Comments
Modifiers were not intended to be used on built in functions (as stated in the docs). It seems that applying modifiers to include did in fact work, however in 3.1.29 and prior. |
@wisskid Oh, I never understood the docs that way actually, as it didn't explicitly exclude built in functions, thanks for clarifying that. What we're trying to do here is wrap a script-Tag around an include result with a modifier. It's more of a convenience function really, but we do use it a lot. We did find a workaround for that, but speaking from experience with smarty in the past it'll most likely break eventually ;-) What I'd like to see with this is smarty throwing some sort of compile error if using a modifier where I shouldn't. Simply swallowing it seems wrong, is that something that could be done? |
That seems very reasonable. I'll see if we can get that in. It would have to go into Smarty 4 as it might break existing code. Hopefully it won't break your workaround :) |
@wisskid great, thanks. We're working on getting rid of most of the inline-templates anyway, it's a massive app though, so you know how that goes ;-) |
We've been running smarty 3.1.29 for a while, since we were having problems with anything newer. Due to the CVE found in smarty we have to give upgrading another go. However, it appears that modifiers no longer work in includes.
{include|dot:"x-template-id" file="included.dot.tpl"}
The plugin is used to wrap the include result in a script tag.
With 3.1.29 the resulting html was:
with newer versions we only get:
Is this anything we can fix ourself with some new config I missed or is it broken?
The text was updated successfully, but these errors were encountered: