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

git-svn-id: http://svn.automattic.com/wordpress/trunk@12460 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
westi 2009-12-19 11:07:16 +00:00
parent 10a6d0e916
commit 7d31610f6f
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, '\\%_');
}
/**