On Sat, Nov 12, 2005 at 06:44:43PM -0700, Pat M. wrote:
h() is just an alias for html_escape, but that doesn’t seem to be
showing up in the docs.
Ah, I see.
Unfortunately I can’t tell you how to reverse h()…but it seems like
you might be using it wrong (or I’m using it wrong, so I’d like to be
corrected!). I was under the impression that it’s just used for
sanitizing output before it’s sent to the browser, so it would be done
in a controller or view.
You’re right. AFAIK, h() is only relevant in the view. I wouldn’t use
h() in a model or controller.
It sounds to me like you’re calling h() when you insert something
into the database, which is unnecessary and you’ll end up running
into the problems you have.
No, my situation is different actually, and it’s a bit complicated (at
least for me). I want to do an inline text editing with AJAX (a la
Flickr). Maybe I’m not doing it right, or just complicating things. So
my asking this is just out of curiosity really.
Anyway, I looked in the source code for html_encode() and it’s just a
one-liner regex substitution, so I can create a helper function that
does the reverse if I want to.
Thanks to everyone who responded. You’ve been very helpful.