![]() |
Cleaning Blog Input
I'm working on a blog service and I'm interested if anyone has any experience in "cleaning" the user input?
Things like recursive regular expressions to clean lists (dl, ul, li, ol etc.) are resource intensive and I imagine other services use simpler methods (which I'm not aware of :-/) Does anybody know of any example code? |
some functions that you might use: strip_tags(), mysql_escape_string() and htmlentities(). Otherwise use standard libraries like HTML Purifier - Filter your HTML the standards-compliant way! to clean user input.
|
Hey cosmok, never heard of "HTML Purifier" until now and it looks like an awesome set of classes!
Life saver mate, cheers! |
glad u found that useful.
|
Yeah, thanks man on that find :)
I've been looking to implent Input_Filter (used by Mambo/Joomla) - but don't like the way it filters :) This is much simpler |
I still prefer
<?php htmlentities(mysql_escape_string($string)); ?> |
htmlspecialchars(addslashes()); works for me most of the time ;D
|
| All times are GMT. The time now is 12:14 AM. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0