Improve like_escape to also escape '\'. Fixes #10041 props miau_jp and Denis-de-Bernardy.

git-svn-id: https://develop.svn.wordpress.org/trunk@12460 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Peter Westwood 2009-12-19 11:07:16 +00:00
parent f0a6bb378b
commit 3081afd1e1
1 changed files with 1 additions and 1 deletions

View File

@ -2410,7 +2410,7 @@ function tag_escape($tag_name) {
* @return string text, safe for inclusion in LIKE query.
*/
function like_escape($text) {
return str_replace(array("%", "_"), array("\\%", "\\_"), $text);
return addcslashes($text, '\\%_');
}
/**