JoelWebsites Posted July 4, 2016 Share Posted July 4, 2016 Dear Guys, All Variables getting HTML escaped in my module in prestashop 1.7 causing module not work.Does anyone know how to fix this issue? Even variables that are not supposed to be HTML escaped are getting escaped and getting printed as text.How do I make prestashop aware about this issue?Please advice 1 Link to comment Share on other sites More sharing options...
rocky Posted July 4, 2016 Share Posted July 4, 2016 This is by design. In PrestaShop v1.7, all Smarty variables are automatically escaped, so you no longer need to manually escape them. You can tell Smarty not to escape your variable by adding nofilter like this: {$variable nofilter} 5 2 Link to comment Share on other sites More sharing options...
JoelWebsites Posted July 5, 2016 Author Share Posted July 5, 2016 Yes rocky solved the error in the same manner Thanks Link to comment Share on other sites More sharing options...
Web VIZO Posted March 22, 2017 Share Posted March 22, 2017 (edited) This is by design. In PrestaShop v1.7, all Smarty variables are automatically escaped, so you no longer need to manually escape them. You can tell Smarty not to escape your variable by adding nofilter like this: {$variable nofilter} Thank you so much, We were debugging PS 1.7 to the core trying to figure out where it was encoding the XML string that we send to Smarty Fetch. Odd thing was that it just was happening with DEV MODE ON, LIVE MODE wasn't encoding anything.. Anyways, thanks! Edited March 22, 2017 by Web VIZO (see edit history) 1 Link to comment Share on other sites More sharing options...
arlevi Posted 9 hours ago Share Posted 9 hours ago (edited) In my version of smarty & prestashop writing {$variable nofilter} causes the template the crash with # ps_wirestransfer <p> {l s='If you have questions, comments or concerns, please contact our [1]customer support team[/1].' mod='ps_wiretransfer' sprintf=['[1]' => "<a href='{$contact_url}'>", '[/1]' => '</a>'] nofilter} </p> # error due to nofilter & sprintf used together ? too many shorthand attributes in module Smarty_Internal_TemplateCompilerBase->trigger_template_error('too many shorth...', 14, true) But if I use some other way of writing <p> {l s='If you have questions, comments or concerns, please contact our [1]expert customer support team[/1].' d='Modules.Wirepayment.Shop' sprintf=['[1]' => "<a href='{$contact_url}'>", '[/1]' => '</a>'] } </p> # This works, BUT # 1) I don't need to add "nofilter" and i see the link # 2) I don't see an option to translate this sentence for some reason ... Any ideas how do I get out of this loop ? Edited 9 hours ago by arlevi (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now