Skip to content

Commit 9c22e90

Browse files
Fixed bug for Php8 - explode(): Passing null to parameter #2 ($string) of type string is deprecated
Deprecated (8192): explode(): Passing null to parameter #2 ($string) of type string is deprecated in [/var/www/html/integrations/vendor/stackify/logger/src/Stackify/Log/Entities/Api/WebRequestDetail.php, line 332]
1 parent 0f9b5f0 commit 9c22e90

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

src/Stackify/Log/Entities/Api/WebRequestDetail.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,14 @@ protected function getRequestUrl()
329329
$https = filter_input(INPUT_SERVER, 'HTTPS');
330330
$ssl = null !== $https && 'off' !== $https;
331331
$protocol = $ssl ? 'https' : 'http';
332-
list($url,) = explode('?', filter_input(INPUT_SERVER, 'REQUEST_URI'));
332+
$inputServerValue = filter_input(INPUT_SERVER, 'REQUEST_URI');
333+
if (is_null($inputServerValue)) {
334+
$url = '';
335+
}
336+
else {
337+
list($url,) = explode('?', $inputServerValue);
338+
}
339+
333340
$serverName = filter_input(INPUT_SERVER, 'SERVER_NAME');
334341
if ($serverName && $url) {
335342
return "$protocol://$serverName" . $url;
@@ -359,4 +366,4 @@ protected function getHeaders($blacklist = null, $whitelist = null)
359366
return self::getRequestMap($headers, $blacklist, $whitelist);
360367
}
361368

362-
}
369+
}

0 commit comments

Comments
 (0)