From 3081afd1e148b3073cb0dd438ffb6d245143208a Mon Sep 17 00:00:00 2001 From: Peter Westwood Date: Sat, 19 Dec 2009 11:07:16 +0000 Subject: [PATCH] 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 --- wp-includes/formatting.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wp-includes/formatting.php b/wp-includes/formatting.php index 21f82d6d12..6472b14cc3 100644 --- a/wp-includes/formatting.php +++ b/wp-includes/formatting.php @@ -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, '\\%_'); } /**