Use strict equality to check if title is empty

This commit is contained in:
Kijin Sung 2024-01-30 20:44:30 +09:00
parent 7cb9b8c786
commit 56af0cb5c3

View file

@ -748,11 +748,11 @@ class DocumentController extends Document
// If the tile is empty, extract string from the contents.
$obj->title = escape($obj->title, false);
if($obj->title == '')
if ($obj->title === '')
{
$obj->title = escape(cut_str(trim(utf8_normalize_spaces(strip_tags($obj->content))), 20, '...'), false);
}
if($obj->title == '')
if ($obj->title === '')
{
$obj->title = 'Untitled';
}
@ -1047,11 +1047,11 @@ class DocumentController extends Document
// If the tile is empty, extract string from the contents.
$obj->title = escape($obj->title, false);
if($obj->title == '')
if ($obj->title === '')
{
$obj->title = escape(cut_str(trim(utf8_normalize_spaces(strip_tags($obj->content))), 20, '...'), false);
}
if($obj->title == '')
if ($obj->title === '')
{
$obj->title = 'Untitled';
}