From 07cee4b0c5b070663926e635e46ecb04f574baa7 Mon Sep 17 00:00:00 2001 From: Anastasia Smolyakova Date: Fri, 2 Feb 2024 20:37:58 +0300 Subject: [PATCH] fix Str::limit --- public/index.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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(