From 0105519188e10a19cccaa43969516e1cdeb59151 Mon Sep 17 00:00:00 2001 From: ghost Date: Tue, 13 Feb 2024 02:04:04 +0200 Subject: [PATCH] fix title detection --- src/Controller/MainController.php | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/Controller/MainController.php b/src/Controller/MainController.php index 8516c7d..b3927fe 100644 --- a/src/Controller/MainController.php +++ b/src/Controller/MainController.php @@ -149,7 +149,7 @@ class MainController extends AbstractController { $index = new \Kvazar\Index\Manticore(); - $title = $index->get( + $results = $index->get( '_KEVA_NS_', [ 'crc32namespace' => crc32( @@ -158,15 +158,17 @@ class MainController extends AbstractController ] ); - if ($title) + if ($results) { - $title = reset( - $title - ); - - return trim( - $title['value'] - ); + foreach ($results as $result) + { + if ($result['key'] == '_KEVA_NS_') + { + return trim( + $result['value'] + ); + } + } } return null;