|
why aren't single quotes turned into '? June 11, 2009 12:00AM |
Registered: 3 years ago Posts: 2 |
Wouldn't you agree that most of which is purified through HTML purifier gets put in a database? SQL queries can easily be injected if single quotes aren't escaped. So why isn't this something HTML Purifier offers? It even converts ' back into '. Why? It even does it with the doctype changed to XHTML 1.1. I have to put str_replace('\'', ''', $text) after $text goes through the purifier.
|
Re: why aren't single quotes turned into '? June 11, 2009 12:37AM |
Admin Registered: 6 years ago Posts: 2,632 |
HTML Purifier normalizes characters into a common, safe form, in order to improve the uniformity of its output. A regular single quote is much prettier than the numeric character entity reference.
With regards to SQL injections, HTML Purifier is not and cannot be in any way related to your database. You must use an appropriate SQL escaping command.
|
Re: why aren't single quotes turned into '? June 27, 2009 08:59AM |
Registered: 4 years ago Posts: 6 |
Use prepared sql statements and sql injection really isn't a problem.
http://dev.mysql.com/tech-resources/articles/4.1/prepared-statements.html
I personally do it via pear::mdb2 but I believe you can also do it with pdo and even the raw mysql driver.
|
Timothy (TRiG)
Re: why aren't single quotes turned into '?January 05, 2010 04:06PM |