diff --git a/src/Api/Service/ModuleTransitionExecutor.php b/src/Api/Service/ModuleTransitionExecutor.php index 1bd38bfda..19279ba96 100644 --- a/src/Api/Service/ModuleTransitionExecutor.php +++ b/src/Api/Service/ModuleTransitionExecutor.php @@ -166,10 +166,8 @@ private function generateTokenizedModuleActionUrl($url): string $composedUrl .= $baseUrl; $queryParams = []; - if (isset($components['query'])) { - $query = $components['query']; - - parse_str($query, $queryParams); + if (is_array($components) && isset($components['query']) && is_string($components['query'])) { + parse_str($components['query'], $queryParams); } if (!isset($queryParams['_token'])) { diff --git a/src/Module/SourceRetriever/AddonsUrlSourceRetriever.php b/src/Module/SourceRetriever/AddonsUrlSourceRetriever.php index 6efced079..f01cdebd9 100644 --- a/src/Module/SourceRetriever/AddonsUrlSourceRetriever.php +++ b/src/Module/SourceRetriever/AddonsUrlSourceRetriever.php @@ -272,7 +272,7 @@ private function assertSourceHasBeenChecked($source): void private function computeAuthentication(string $source): array { $url_parts = parse_url($source); - if (isset($url_parts['query'])) { + if (is_array($url_parts) && isset($url_parts['query']) && is_string($url_parts['query'])) { parse_str($url_parts['query'], $params); } else { $params = []; diff --git a/src/Traits/Hooks/UseActionListModules.php b/src/Traits/Hooks/UseActionListModules.php index 603f480b6..fa0a2543b 100644 --- a/src/Traits/Hooks/UseActionListModules.php +++ b/src/Traits/Hooks/UseActionListModules.php @@ -68,6 +68,7 @@ public function hookActionListModules(): array } } catch (Exception $exception) { ErrorHelper::reportError($exception); + return []; } $filters = $filtersFactory->create(); @@ -85,7 +86,11 @@ public function hookActionListModules(): array $catalogUrl = $router->generate('admin_mbo_catalog_module', []); $catalogUrlParts = parse_url($catalogUrl); - parse_str($catalogUrlParts['query'], $catalogUrlParams); + $catalogUrlParams = []; + + if (is_array($catalogUrlParts) && isset($catalogUrlParts['query']) && is_string($catalogUrlParts['query'])) { + parse_str($catalogUrlParts['query'], $catalogUrlParams); + } /** * @var ModuleInterface $module @@ -137,6 +142,7 @@ private function getAdditionalDescription(string $moduleUrl, string $moduleName) } } catch (Exception $exception) { ErrorHelper::reportError($exception); + return ''; }