From 2013f64a39447dc17c8b913c63b59251dd2025e6 Mon Sep 17 00:00:00 2001 From: Brian Huisman Date: Thu, 20 Apr 2023 16:11:56 -0400 Subject: [PATCH] Use raw title for JSON (typeahead) output --- orcinus/search.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/orcinus/search.php b/orcinus/search.php index a8bf629..0d15be7 100644 --- a/orcinus/search.php +++ b/orcinus/search.php @@ -609,6 +609,7 @@ if ($_RDATA['s_searchable_pages']) { $result['url'] = preg_replace($repStr, '', $result['url']); // Highlight the terms in the title, url and matchtext + $_RESULT->title_raw = $result['title']; $_RESULT->title = htmlspecialchars($result['title']); $_RESULT->url = htmlspecialchars($result['url']); $_RESULT->matchtext = htmlspecialchars($result['matchtext']); @@ -668,6 +669,8 @@ if ($_RDATA['s_searchable_pages']) { $_ORCINUS->searchable->searched->results->in = number_format(microtime(true) - $_SDATA['time'], 2, '.', ''); $_SDATA['json'] = array_slice($_ORCINUS->searchable->searched->results->result_list, 0, 5); + foreach ($_SDATA['json'] as $key => $value) + $_SDATA['json'][$key]->title = $value->title_raw; } // No results