Maybe something like this:
var $swaps = array('\n','\r','\\');
function unSanitize($str)
{
foreach($swaps in $item)
{
/* search for the item as \n or \r then put it in quotes for php
to evaluate it and replace it back in */
$str = str_replace($item, "{$item}", $str);
}
}
Something like that might work. I haven't tested it, but it might get
you started.
Brian
On Jan 29, 1:05 am, senseBOP <[EMAIL PROTECTED]> wrote:
> Hey guys, hope I'm posting this in the right group and all...
>
> Unless there's another way to go about this, shouldn't the Sanitize
> class also include a method to un-escape sanitized data back into a
> readable, user-friendly, format? Otherwise, what's the point of having
> it sanitized?
>
> I'm no big expert, and there's probably a way for me to un-escape data
> from the database before displaying it back to the user, but so far, I
> have failed to find such a way. And to me, it only makes sense that
> the class that is responsible for re-formatting the data going into
> the DB will also be responsible to format it back to readable form
> once it is pulled from the DB.
>
> What's your take on this?
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---