From aa2a2906153c977f5cee4ac2cb6b1a8a54460ca2 Mon Sep 17 00:00:00 2001 From: yggverse Date: Sun, 14 Apr 2024 22:27:11 +0300 Subject: [PATCH] fix first array value detection --- src/Entity/Tab/Page.php | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/Entity/Tab/Page.php b/src/Entity/Tab/Page.php index 7415aa6f..e0fc4061 100644 --- a/src/Entity/Tab/Page.php +++ b/src/Entity/Tab/Page.php @@ -550,8 +550,9 @@ class Page if ($h1 = $body->getH1()) { - $title = $h1[0] . - $this->app->config->header->title->postfix; + $title = reset( + $h1 + ) . $this->app->config->header->title->postfix; } else @@ -608,7 +609,7 @@ class Page // Ignore history record on same URL stored if ($result = $this->app->database->getHistory('', 0, 1)) { - if ($url == $result[0]->url) + if ($url == reset($result)->url) { $history = false; } @@ -649,12 +650,16 @@ class Page if ($h1 = $body->getH1()) { + $title = reset( + $h1 + ); + $this->app->setTitle( - $h1[0] + $title ); $this->setTitle( - $h1[0] + $title ); } }