You are here: Re: Filtering and Escaping (Was: Select and $_POST) « PHP « IT news, forums, messages
Re: Filtering and Escaping (Was: Select and $_POST)

Posted by Ben Ramsey on 11/15/05 00:13

On 11/14/05 3:38 PM, Richard Lynch wrote:
> Perhaps one should use:
> $_ICLEAN
> $_OCLEAN
> for Input and Output.
>
> $kosher = '/[^A-Za-z0-9\\',\\.-]/';
> $_ICLEAN['first_name'] = preg_replace($kosher, '', $_GET['first_name'];
> /* more code */
> $_OCLEAN['first_name'] = htmlentities($_ICLEAN['first_name']);
> echo "<p>$_OCLEAN[first_name] is way smarter than me.</p>\n";
>
> If you had anything other than $_OCLEAN in an echo and friends, then
> you would know you were screwing up.

I don't like $_OCLEAN primarily because I like Chris's suggestion of
using an output array that is named according to where the data is
going, so $url, $sql, $html, etc. But, with that in mind, it wouldn't be
too hard to use $_OCLEAN['url'], $_OCLEAN['sql'], and $_OCLEAN['html']
as arrays within the $_OCLEAN array.

--
Ben Ramsey
http://benramsey.com/

 

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

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