Re: [SMARTY] How do you deal with special chars in template vars?

From: Date: Tue, 16 Jul 2002 20:55:13 +0000
Subject: Re: [SMARTY] How do you deal with special chars in template vars?
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-5344@lists.php.net to get a copy of this message
default modifiers are on the todo list. I would not advise putting formatting in your db content, it only defeats the purpose. Bogien wrote:
How do you deal with special characters in template variables? This can be annoying (lots of |htmlspecialchars): <html>
    <body>
      Welcome, {$name|htmlspecialchars} {$surname|htmlspecialchars}!<br>
      Here is your review: {$review|htmspecialschars}<br>
      Here are the comments: {$comments|htmspecialschars}<br>
    </body>
</html> I used to store htmlspecialchars()'ed data in database, but it leads to such conflicts: INSERT INTO base VALUES (1, '&quot; Henry the Great &quot;'); SELECT FROM base WHERE name LIKE '%quot%'; <-- shouldn't find anything,
                                                 but it will
-- Monte Ohrt <monte@ispi.net> Director of Technology, ispi Inc.

« previous php.smarty.general (#5344) next »