使用WordPress内置函数存储数据时的SQL安全性

MTV*_*TVS 8 security wordpress sql-injection

当我使用WordPress内置函数时

add_post_meta, update_post_meta, add_user_meta, update_user_meta

wp_insert_post, wp_insert_user

在将用户输入数据传递给这些函数之前,我应该进行任何转义或清理吗?或者这些函数本身可以解决问题吗?

这里在codex中Action_Reference/save_post将数据传递到update_post_meta右边$_POST.

dig*_*ggy 5

可以使用来清理元值,通过来清理sanitize_meta帖子内容wp_kses_post,等等。您可以放心地认为内置函数是安全的。