I'm trying to understand how datas are being handled when saving to the database in the wpdb class. I have searched for where HTML string datas are handled and found a method in the $this->query() method in the wpdb class where the query string is being stripped and thought it could be there. It's on line 1798. The $query string variable is stripped:
$stripped_query = $this->strip_invalid_text_from_query( $query );
But then I don't understand. I just can't find the stripped variable $stripped_query to be used in a query after that. The method is just returning false if it's not exactly like the original?:
if ( $stripped_query !== $query ) {
$this->insert_id = 0;
return false;
}
Why? Maybe I have misunderstood what strip_invalid_text_from_query() is doing?
Anyway.. As I said, I just wanna find the method that fixes HTML to a database safe string. So that not for example line-breaks destroys the query or so. Does anyone know where that is?