From 9fbedbe663bb274e8ad8824d38228e2c3c5d1fa0 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Sun, 4 Feb 2024 20:34:12 +0000 Subject: [PATCH] update --- Admin/Install/SearchCommands.php | 8 ++++---- Controller/SearchController.php | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Admin/Install/SearchCommands.php b/Admin/Install/SearchCommands.php index 1bed59f..9e8333f 100755 --- a/Admin/Install/SearchCommands.php +++ b/Admin/Install/SearchCommands.php @@ -18,7 +18,7 @@ use phpOMS\Account\PermissionType; use phpOMS\Router\RouteVerb; return [ - '^:help (\?.*$|$)' => [ + '^:help (?!:).+.*?' => [ [ 'dest' => '\Modules\Help\Controller\SearchController:searchHelp', 'verb' => RouteVerb::ANY, @@ -29,7 +29,7 @@ return [ ], ], ], - '^:help :user (\?.*$|$)' => [ + '^:help :user .*?' => [ [ 'dest' => '\Modules\Help\Controller\SearchController:searchHelp', 'verb' => RouteVerb::ANY, @@ -40,7 +40,7 @@ return [ ], ], ], - '^:help :dev (\?.*$|$)' => [ + '^:help :dev .*?' => [ [ 'dest' => '\Modules\Help\Controller\SearchController:searchHelp', 'verb' => RouteVerb::ANY, @@ -51,7 +51,7 @@ return [ ], ], ], - '^:help :module (\?.*$|$)' => [ + '^:help :module .*?' => [ [ 'dest' => '\Modules\Help\Controller\SearchController:searchHelp', 'verb' => RouteVerb::ANY, diff --git a/Controller/SearchController.php b/Controller/SearchController.php index facddcd..0c1a049 100755 --- a/Controller/SearchController.php +++ b/Controller/SearchController.php @@ -108,8 +108,8 @@ final class SearchController extends Controller $summaryEnd - $summaryStart ); - $files[$module['name']['internal']][] = [ - 'title' => $module['name']['external'] . ': ' . \trim($headline, " #\r\n\t"), + $files[] = [ + 'title' => \trim($headline, " #\r\n\t"), 'summary' => \trim($summary, " #\r\n\t"), 'link' => $path . '/' . $file, 'account' => '', @@ -127,6 +127,6 @@ final class SearchController extends Controller // @todo probably cleanup return for link generation + sort by best match $response->header->set('Content-Type', MimeType::M_JSON . '; charset=utf-8', true); - $response->set($request->uri->__toString(), $files); + $response->add($request->uri->__toString(), $files); } }