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:
parent
10a6d0e916
commit
7d31610f6f
|
@ -2410,7 +2410,7 @@ function tag_escape($tag_name) {
|
||||||
* @return string text, safe for inclusion in LIKE query.
|
* @return string text, safe for inclusion in LIKE query.
|
||||||
*/
|
*/
|
||||||
function like_escape($text) {
|
function like_escape($text) {
|
||||||
return str_replace(array("%", "_"), array("\\%", "\\_"), $text);
|
return addcslashes($text, '\\%_');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue