Purifier
Purifier copied to clipboard
CleanHtml cast returns an empty string when database value is null
I have a field in database, i.e. html_content. The field is nullable and by default is null, but it may contain some HTML content.
Model casts this field using CleanHtml class and the result of $model->html_content when html_content is null is an empty string, instead of null value.
Isn't it supposed to return null value, because null value may indicate certain things when rendering pages on the front-end, etc.?