From 4764561795f99c153c5c57b38fc54784be464fbb Mon Sep 17 00:00:00 2001 From: Pierre Ducoudray Date: Mon, 15 May 2023 18:28:25 +0200 Subject: [PATCH] Update Parser.php Fix warning with php8.1 --- src/Snowplow/RefererParser/Parser.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Snowplow/RefererParser/Parser.php b/src/Snowplow/RefererParser/Parser.php index 0c8931d..4fc4e33 100644 --- a/src/Snowplow/RefererParser/Parser.php +++ b/src/Snowplow/RefererParser/Parser.php @@ -50,7 +50,10 @@ public function parse($refererUrl, $pageUrl = null) $searchTerm = null; if ($referer['parameters']) { - parse_str($refererParts['query'], $queryParts); + $queryParts = []; + if (null !== $refererParts['query']) { + parse_str($refererParts['query'], $queryParts); + } foreach ($referer['parameters'] as $parameter) { $searchTerm = isset($queryParts[$parameter]) ? $queryParts[$parameter] : $searchTerm; }