Changeset 8541 for trunk/src/bp-core/bp-core-functions.php
- Timestamp:
- 06/19/2014 01:36:57 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/bp-core-functions.php
r8511 r8541 263 263 $order = strtoupper( trim( $order ) ); 264 264 return 'DESC' === $order ? 'DESC' : 'ASC'; 265 } 266 267 /** 268 * Escape special characters in a SQL LIKE clause. 269 * 270 * In WordPress 4.0, like_escape() was deprecated, due to incorrect 271 * documentation and improper sanitization leading to a history of misuse. To 272 * maintain compatibility with versions of WP before 4.0, we duplicate the 273 * logic of the replacement, wpdb::esc_like(). 274 * 275 * @since BuddyPress (2.1.0) 276 * 277 * @see wpdb::esc_like() for more details on proper use. 278 * 279 * @param string $text The raw text to be escaped. 280 * @return string Text in the form of a LIKE phrase. Not SQL safe. Run through 281 * wpdb::prepare() before use. 282 */ 283 function bp_esc_like( $text ) { 284 global $wpdb; 285 286 if ( method_exists( $wpdb, 'esc_like' ) ) { 287 return $wpdb->esc_like( $text ); 288 } else { 289 return addcslashes( $text, '_%\\' ); 290 } 265 291 } 266 292
Note: See TracChangeset
for help on using the changeset viewer.