sanitize_post() is not sanitizing Post Object

Solution:

sanitize_post is coming with “display” default filter option. And it does not sanitize tags.

But if you tries a code like this:

 $sanitizer = function($post){
 return sanitize_post($post, "db"); // or "edit"
};

array_map($sanitizer, $data["post"]);

Now it sanitizes fields against XSS!

enter image description here

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)