开发者

Non-translated single quote

开发者 https://www.devze.com 2023-02-16 03:19 出处:网络
I have a strange problem: htmlspecialchars(with ENT_QUOTES) and mysql_real_escape_string functions aren\'t translating sin开发者_如何学运维gle quote in i\'ve(and some others words), all others are tra

I have a strange problem: htmlspecialchars(with ENT_QUOTES) and mysql_real_escape_string functions aren't translating sin开发者_如何学运维gle quote in i've(and some others words), all others are translated, what is the reason of that result?


It may be that what you think is a normal quote (', or HTML ') is actually a curly apostrophe (’, or HTML ’). This will not be transformed by htmlspecialchars (nor mysql_real_escape_string, as it is not a valid quote for MySQL). htmlentities should escape this.


If you want escaping use htmlentities()

0

精彩评论

暂无评论...
验证码 换一张
取 消