What does mysql_real_escape_string()
do with the %
(percent) character and how much of a security risk does it represent (and how to fix it)?
相关问题
- Views base64 encoded blob in HTML with PHP
- Laravel Option Select - Default Issue
- PHP Recursively File Folder Scan Sorted by Modific
- Can php detect if javascript is on or not?
- Using similar_text and strpos together
From the
mysql_real_escape_string()
documentation:As far as security, unless you are running a
LIKE
,GRANT
, orREVOKE
, it's a non-issue.LIKE
is probably the only real concern. It's up to you how you would want to escape it in these situations.A quick example:
It does not do nothing with % character. Why didn't you try it?
Taken from:
http://php.net/manual/en/function.mysql-real-escape-string.php