mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-05-29 15:44:27 +00:00
LIKE escape sanity:
* Deprecate `like_escape()` * Add a method to `$wpdb`, `->esc_like()`, and add unit tests `$wpdb::esc_like()` is not used yet. As such, many unit tests will throw `Unexpected deprecated notice for like_escape`. Subsequent commits will alleviate this. Props miqrogroove. See #10041. git-svn-id: https://develop.svn.wordpress.org/trunk@28711 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -3099,18 +3099,6 @@ function tag_escape($tag_name) {
|
||||
return apply_filters( 'tag_escape', $safe_tag, $tag_name );
|
||||
}
|
||||
|
||||
/**
|
||||
* Escapes text for SQL LIKE special characters % and _.
|
||||
*
|
||||
* @since 2.5.0
|
||||
*
|
||||
* @param string $text The text to be escaped.
|
||||
* @return string text, safe for inclusion in LIKE query.
|
||||
*/
|
||||
function like_escape($text) {
|
||||
return str_replace(array("%", "_"), array("\\%", "\\_"), $text);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert full URL paths to absolute paths.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user