Welcome Guest, Not a member yet? Register   Sign In
Can't escape apostrophe... Any ideas?
#2

[eluser]dallen33[/eluser]
I figured out how to fix it by doing a find and replace.
Code:
$search = array('’');
        $replace = array('\'');
        $notes_cleaned = html_entity_decode(str_replace($search, $replace, htmlentities($notes)));

Is this a bug in CodeIgniter? It's always done a great job of escaping characters, but this one hasn't worked at all. But now that I do a search and replace, it works flawlessly.

Maybe this'll help someone else out in the future!

EDIT: Just FYI, the character that wasn't escaping is a Word doc apostrophe. It has an HTML number of ’. Someone was copying text from a Word doc and pasted it in a textarea.


Messages In This Thread
Can't escape apostrophe... Any ideas? - by El Forum - 09-17-2009, 11:52 AM
Can't escape apostrophe... Any ideas? - by El Forum - 09-17-2009, 01:29 PM



Theme © iAndrew 2016 - Forum software by © MyBB