Warning: This method has been deprecated. Use wpdb::prepare() instead.
wpdb::_weak_escape() WordPress Method
The wpdb::_weak_escape() method is used to escape data for use in a SQL query. This method should not be used for user-provided data, as it does not escape all characters that could be used to inject malicious code into a query.
wpdb::_weak_escape( string $string ) #
Do not use, deprecated.
Description
Use esc_sql() or wpdb::prepare() instead.
See also
Parameters
- $string
(string)(Required)
Return
(string)
Source
File: wp-includes/wp-db.php
public function _weak_escape( $string ) { if ( func_num_args() === 1 && function_exists( '_deprecated_function' ) ) { _deprecated_function( __METHOD__, '3.6.0', 'wpdb::prepare() or esc_sql()' ); } return addslashes( $string ); }
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
3.6.0 | Use wpdb::prepare() |
2.8.0 | Introduced. |