Purifier icon indicating copy to clipboard operation
Purifier copied to clipboard

CleanHtml cast returns an empty string when database value is null

Open lyyka opened this issue 3 years ago • 0 comments

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.?

lyyka avatar Aug 05 '22 10:08 lyyka