From 12150386cba03d26600a29667a3644b5344d5cc6 Mon Sep 17 00:00:00 2001 From: Rebecca Hum Date: Tue, 9 Jul 2024 11:41:34 -0600 Subject: [PATCH 1/2] Fix Uncaught TypeError: parse_url(): Argument #1 () must be of type string, null given --- collectors/http.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/collectors/http.php b/collectors/http.php index 3a3ff33c..8d678ec2 100644 --- a/collectors/http.php +++ b/collectors/http.php @@ -369,7 +369,7 @@ public function process() { $this->data->ltime += $ltime; - $host = (string) parse_url( $request['url'], PHP_URL_HOST ); + $host = (string) parse_url( $request['url'] ?? '', PHP_URL_HOST ); $local = ( $host === $home_host ); $this->log_type( $type ); From ce01ab6e4ce7f3923cf8d51cbc9c6ed095a36b7d Mon Sep 17 00:00:00 2001 From: Rebecca Hum Date: Tue, 9 Jul 2024 14:26:37 -0600 Subject: [PATCH 2/2] Add question mark per suggestion --- collectors/http.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/collectors/http.php b/collectors/http.php index 8d678ec2..2541d69d 100644 --- a/collectors/http.php +++ b/collectors/http.php @@ -27,7 +27,7 @@ class QM_Collector_HTTP extends QM_DataCollector { /** * @var array> * @phpstan-var array, * filtered_trace: list>,