Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

htmlspecialchars

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Language: German
View previous topic :: View next topic  
Author Message
kenguruh
Smarty Rookie


Joined: 17 Aug 2012
Posts: 7
Location: Germany

PostPosted: Thu Mar 13, 2014 10:59 am    Post subject: htmlspecialchars Reply with quote

Hallo,

Ich habe Formulare mit sehr vielen Input und Textarea Feldern... Damit "Hallo" (mit ") angezeigt wird, muss man ja htmlspecialchars anwenden.

Gibt es bei Smarty eine Möglichkeit, dass alle Felder mit htmlspecialchars versehen werden? Oder muss man überall {$variable|htmlspecialchars} angeben?

Mfg Kenguruh

P.S.: Meine Frage ist ja Blödsinn... Woher soll Smarty wissen, ob die {$variable} in einem Input oder in einem normalen Text vorkommt. Im Text wäre es ja dann kontraproduktiv...
Back to top
View user's profile Send private message
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 5068
Location: Hamburg / Germany

PostPosted: Sun Mar 16, 2014 7:48 am    Post subject: Reply with quote

$smarty->escape_html = true;

Siehe http://www.smarty.net/docs/en/variable.escape.html.tpl
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Language: German All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP