diff --git a/sources/application/UI/Component/GlobalSearch/GlobalSearch.php b/sources/application/UI/Component/GlobalSearch/GlobalSearch.php index e818ee47f..d26aca458 100644 --- a/sources/application/UI/Component/GlobalSearch/GlobalSearch.php +++ b/sources/application/UI/Component/GlobalSearch/GlobalSearch.php @@ -52,15 +52,15 @@ class GlobalSearch extends UIBlock * GlobalSearch constructor. * * @param string $sId - * @param array $aLastClasses + * @param array $aLastQueries * * @throws \Exception */ - public function __construct($sId = null, $aLastClasses = []) + public function __construct($sId = null, $aLastQueries = []) { parent::__construct($sId); $this->SetEndpoint(static::DEFAULT_ENDPOINT_REL_URL); - $this->SetLastQueries($aLastClasses); + $this->SetLastQueries($aLastQueries); } /** diff --git a/sources/application/UI/Component/GlobalSearch/GlobalSearchHelper.php b/sources/application/UI/Component/GlobalSearch/GlobalSearchHelper.php index 624da1bc6..9bb2122b2 100644 --- a/sources/application/UI/Component/GlobalSearch/GlobalSearchHelper.php +++ b/sources/application/UI/Component/GlobalSearch/GlobalSearchHelper.php @@ -101,19 +101,26 @@ class GlobalSearchHelper * @throws \CoreException * @throws \CoreUnexpectedValue * @throws \MySQLException + * @throws \Exception */ public static function GetLastQueries() { /** @var array $aHistoryEntries */ $aHistoryEntries = appUserPreferences::GetPref(static::USER_PREF_CODE, []); - // Add HTML label if missing for($iIdx = 0; $iIdx < count($aHistoryEntries); $iIdx++) { + // Add HTML label if missing if(!isset($aHistoryEntries[$iIdx]['label_html'])) { $aHistoryEntries[$iIdx]['label_html'] = utils::HtmlEntities($aHistoryEntries[$iIdx]['query']); } + + // Set absolute URL + if(isset($aHistoryEntries[$iIdx]['icon_url'])) + { + $aHistoryEntries[$iIdx]['icon_url'] = utils::GetAbsoluteUrlAppRoot().$aHistoryEntries[$iIdx]['icon_url']; + } } return $aHistoryEntries;