Add esc_sql(), for completeness.

git-svn-id: http://svn.automattic.com/wordpress/trunk@11490 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
markjaquith 2009-05-29 20:31:52 +00:00
parent c652a8f9e3
commit cacfffd068
1 changed files with 15 additions and 0 deletions

View File

@ -2061,6 +2061,21 @@ function clean_url( $url, $protocols = null, $context = 'display' ) {
return apply_filters('clean_url', $url, $original_url, $context); return apply_filters('clean_url', $url, $original_url, $context);
} }
/**
* Escapes data for use in a MySQL query
*
* This is just a handy shortcut for $wpdb->escape(), for completeness' sake
*
* @since 2.8.0
* @param string $sql Unescaped SQL data
* @return string The cleaned $sql
*/
function esc_sql( $sql ) {
global $wpdb;
return $wpdb->escape( $sql );
}
/** /**
* Checks and cleans a URL. * Checks and cleans a URL.
* *