Smarty Template escaping related issues

Source: Internet
Author: User
Escaping problems with Smarty templates
I use <textarea>text box submit the following content</textarea>

      <{assign var= "S" value=1}>
      <{foreach item=adv key=key from= $adv}>
    • <{if $s%4="=" 0}="">Class= "MRO" <{/if}>> ">" width= "293" height= "189"/>
      <{assign var= "s" value= $s +1}>
      <{/foreach}>


In the background with Addslashes escaped a bit into the database, the foreground is to go with stripslashes escape, but, smarty template output is
      <{assign var= "s" value=1}> <{foreach item=adv key=key from= $adv}>
    • <{if $s%4="=" 0}="">class= "MRO" <{/if}>> ">" width= "293" height= "189"/> <{assign var= "s" value= $s +1}> <{/ Foreach}>
is not output in HTML style why is this?? I use |escape: "HTML" escape also not
------to solve the idea----------------------
What do you want out of the way?
------to solve the idea----------------------
Smarty and your content escape seems to have nothing to do with it, not very understanding of what problems you encounter?
------to solve the idea----------------------
You are going to customize the output of the loop,
But Smarty should be, first PHP code and then assign to the template.
What you should mean is assign to the template, and then let Smarty parse it again.

I don't think so, I suggest you write this loop to the template file when you submit it in the background.
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.