Nolongerused3921 Posted January 1, 2007 Share Posted January 1, 2007 Well the title says it all, right now I'm using[code=php:0] function strip_array($data, $filter_type) { foreach ($data as &$tmp_data) { if (get_magic_quotes_gpc()) { $tmp_data = stripslashes($tmp_data); } if ($filter_type == 2) { $tmp_data = htmlentities($tmp_data); } elseif (!is_numeric($tmp_data)) { $tmp_data = htmlspecialchars($tmp_data, ENT_QUOTES); } } return $data; }[/code]To make the input safe (Actually, anything passed through post goes through this and returns as a nice and neat array), but I'm wondering - should I do more? Should I take out all <'s to remove html? Are there any other vulnerabilities that I should worry about?Also, how should I make this back into what it originally was on output, without risking anything? Link to comment https://forums.phpfreaks.com/topic/32448-best-way-to-make-input-safe-on-input-then-readable-on-output/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.