From eaab6872a3c8f7dea31eb24a1502cd00bdc46ab7 Mon Sep 17 00:00:00 2001 From: Davi Alexandre Date: Mon, 29 Oct 2018 15:46:27 -0300 Subject: [PATCH] Avoid E_NOTICE when Home URL does not contain a query string The list assignment will result in an E_NOTICE when the Home URL does not contain a query string, because the array returned by the explode() call will contain only one item. --- CRM/Core/BAO/Navigation.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CRM/Core/BAO/Navigation.php b/CRM/Core/BAO/Navigation.php index 0f9cde9295..68a8de1985 100644 --- a/CRM/Core/BAO/Navigation.php +++ b/CRM/Core/BAO/Navigation.php @@ -598,7 +598,9 @@ FROM civicrm_navigation WHERE domain_id = $domainID"; $homeIcon = ''; self::retrieve($homeParams, $homeNav); if ($homeNav) { - list($path, $q) = explode('?', $homeNav['url']); + $path = parse_url($homeNav['url'], PHP_URL_PATH); + $q = parse_url($homeNav['url'], PHP_URL_QUERY); + $homeURL = CRM_Utils_System::url($path, $q); $homeLabel = $homeNav['label']; // CRM-6804 (we need to special-case this as we don’t ts()-tag variables) -- 2.25.1