diff --git a/public/index.php b/public/index.php index 86f6fcd..5f2c7c8 100644 --- a/public/index.php +++ b/public/index.php @@ -192,10 +192,10 @@ if (!empty($resBody)) { $document = new Document($resBody); - $h1 = Str::limit(optional($document->first('h1'))->text(), 250, '(...)'); - $title = Str::limit(optional($document->first('title'))->text(), 250, '(...)'); + $h1 = Str::limit(optional($document->first('h1'))->text() ?? '', 250, '(...)'); + $title = Str::limit(optional($document->first('title'))->text() ?? '', 250, '(...)'); $description = Str::limit(optional($document->first('meta[name="description"]')) - ->getAttribute('content'), 250, '(...)'); + ->getAttribute('content') ?? '', 250, '(...)'); } $newCheckQuery = 'INSERT INTO url_checks(