You are here: assign_integer() convenience wrapper « Smarty Templates Posts « IT news, forums, messages
assign_integer() convenience wrapper

Posted by Samuel Abels on 09/27/34 11:22

Hello,

I have a feature request: Often, it would be nice to ensure the type
safety of a variable before passing it into the template, to prevent
template authors from erroneously exposing unchecked values. For
example, insufficently checked (user manipulatable) integer values may
lead to possible Javascript injections if not casted before passed into
the template.
So to maintain safety, all such values need to be casted before being
assigned:

settype($_GET[id], 'integer');
$smarty->assign('id', $_GET[id]);

I found this to be a very common task and I believe it would be very
convenient if there were a method to do this.

$smarty->assign_integer('id', $_GET[id]);

(Of course I could just derive from Smarty and add a method myself, but
it may be a useful feature generally.)

-Samuel

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация