wpseek.com
Bazujące na WordPress narzędzie wyszukiwania dla deweloperów i twórców motywów.



esc_sql › WordPress Function

Od2.8.0
Przestarzałyn/a
esc_sql ( $data )
Parametry:
  • (string|array) $data Unescaped data.
    Wymagane: Tak
Powrót:
  • (string|array) Escaped data, in the same type as supplied.
Zdefiniowane na:
Codex:

Escapes data for use in a MySQL query.

Usually you should prepare queries using wpdb::prepare(). Sometimes, spot-escaping is required or useful. One example is preparing an array for use in an IN clause. NOTE: Since 4.8.3, '%' characters will be replaced with a placeholder string, this prevents certain SQLi attacks from taking place. This change in behavior may cause issues for code that expects the return value of esc_sql() to be usable for other purposes.


Powiązane Funkcje: esc_js, esc_url, esc_xml, esc_html, is_ssl

Źródło

function esc_sql( $data ) {
	global $wpdb;
	return $wpdb->_escape( $data );
}