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.

Top ↑

See also


Top ↑

Parameters

$string

(string)(Required)


Top ↑

Return

(string)


Top ↑

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 );
	}


Top ↑

Changelog

Changelog
VersionDescription
3.6.0Use wpdb::prepare()
2.8.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.