Make WordPress Core


Ignore:
Timestamp:
01/29/2008 05:20:27 PM (16 years ago)
Author:
ryan
Message:

like_escape() from nbachiyski. see #5684

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/formatting.php

    r6632 r6680  
    11651165    return apply_filters('attribute_escape', $safe_text, $text);
    11661166}
     1167/**
     1168 * Escapes text for SQL LIKE special characters % and _
     1169 *
     1170 * @param string text the text to be escaped
     1171 * @return string text, safe for inclusion in LIKE query
     1172 */
     1173function like_escape($text) {
     1174    return str_replace(array("%", "_"), array("\\%", "\\_"), $text);
     1175}
    11671176
    11681177function wp_make_link_relative( $link ) {
Note: See TracChangeset for help on using the changeset viewer.