mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 22:30:04 +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:
@@ -3458,6 +3458,21 @@ function format_to_post( $content ) {
|
||||
return $content;
|
||||
}
|
||||
|
||||
/**
|
||||
* Formerly used to escape strings before searching the DB. It was poorly documented and never worked as described.
|
||||
*
|
||||
* @since 2.5.0
|
||||
* @deprecated 4.0.0
|
||||
* @deprecated Use wpdb::esc_like()
|
||||
*
|
||||
* @param string $text The text to be escaped.
|
||||
* @return string text, safe for inclusion in LIKE query.
|
||||
*/
|
||||
function like_escape($text) {
|
||||
_deprecated_function( __FUNCTION__, '4.0', 'wpdb::esc_like()' );
|
||||
return str_replace( array( "%", "_" ), array( "\\%", "\\_" ), $text );
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines if the URL can be accessed over SSL.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user