From 7d31610f6fb70210280dedbf87ba3d5d32563853 Mon Sep 17 00:00:00 2001 From: westi 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: http://svn.automattic.com/wordpress/trunk@12460 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- 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, '\\%_'); } /**