note 85593 deleted from function.htmlentities by danbrown
| From: | danbrown@php.net | Date: | Sun, 17 May 2009 16:46:21 +0000 |
| Subject: | note 85593 deleted from function.htmlentities by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-154887@lists.php.net to get a copy of this message | ||
Note Submitter: anotheruser at example dot com
----
Followup to anotheruser at example dot com
02-Aug-2008 02:12
There's a couple of parts in the code which make the post eligible for deletion.
The foreach loop can be replaced by array_walk. As halocastle at yahoo dot com mentioned, the key
names passed by the user in post/get are suspect as well, but weren't handled in the example.
Altering post/get arrays directly is bad form. The example should be used under very specific
situations contrary to what I had originally suggested. Also, I'd agree with kjarli at gmail
dot com that there are probably better alternatives to htmlentities for scrubbing data for db
storage.
The function as edited by the moderators is broken. It has no return value or doesn't set the
value passed by reference. Passing $txtArray by reference doesn't make sense when used like
"$array = htmlizeArray($array);" and it destroys $array as is. Htmlize_text is not a
callable function since it was renamed to htmlizeArray in the example.
So, Mods - please delete this side thread.