esc_sql
函数
esc_sql ( $data )
- 参数
-
-
(string|array)
$data
Unescaped data.- Required: 是
-
(string|array)
- 返回值
-
- (string|array) Escaped data, in the same type as supplied.
- 定义位置
-
-
wp-includes/formatting.php
, line 4348
-
wp-includes/formatting.php
- 引入
- 2.8.0
- 弃用
- –
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 useable
for other purposes.
function esc_sql( $data ) { global $wpdb; return $wpdb->_escape( $data ); }
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。