But why do hyphens need to be escaped in the first place?
I looked at the function cleanValue (that is called by cleanArray) and
it makes several replacements, some of them look weird, for example:
$val = str_replace("!", "!", $val);
$val = str_replace("'", "'", $val);
I guess the intention was to write something like $val =
str_replace("'", "'", $val); but were copied from some web page
and the entities got lost.
I prefer to stick to the regular php function htmlspecialchars;
writing your own wrapper for this function to operate on arrays is
very easy.
On Mar 7, 8:32 pm, "squidliberty" <[EMAIL PROTECTED]> wrote:
> I have several areas of my site where it is necessary to sanitize
> large amounts of user form data. cleanArray() makes this process a
> breeze - however, I have found that it replaces hyphens ('-') with the
> htmlentity equivalent ('-'). This is a big problem for email
> addresses, which may contain hyphens.
>
> How should I be handling this? My best solution was to create a
> fixSafeChar() function to convert the hyphens back. But this seems
> pretty crude.
>
> Any suggestions? Is cleanArray() not the right function for the task?
>
> Thanks!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---