From 9ae2bdd1285b46eac927d21e0945ac26e92c2470 Mon Sep 17 00:00:00 2001 From: Phil Tyler Date: Fri, 8 Mar 2024 12:00:16 -0800 Subject: [PATCH] [BUGS-7554] Fix php 8.x warning in Apache Solr module --- .../pantheon_apachesolr/Pantheon_Apache_Solr_Service.php | 2 +- .../pantheon_apachesolr/Pantheon_Search_Api_Solr_Service.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/pantheon/pantheon_apachesolr/Pantheon_Apache_Solr_Service.php b/modules/pantheon/pantheon_apachesolr/Pantheon_Apache_Solr_Service.php index 2d7a5fadc0c..c06d8ad674d 100644 --- a/modules/pantheon/pantheon_apachesolr/Pantheon_Apache_Solr_Service.php +++ b/modules/pantheon/pantheon_apachesolr/Pantheon_Apache_Solr_Service.php @@ -497,7 +497,7 @@ protected function _makeHttpRequest($url, $options = array()) { list($result->protocol, $result->code, $result->status_message) = explode(' ', trim(array_shift($split)), 3); // Parse headers. $result->headers = array(); - while ($line = trim(array_shift($split))) { + while (!empty($split) && $line = trim(array_shift($split))) { list($header, $value) = explode(':', $line, 2); if (isset($result->headers[$header]) && $header == 'Set-Cookie') { // RFC 2109: the Set-Cookie response header comprises the token Set- diff --git a/modules/pantheon/pantheon_apachesolr/Pantheon_Search_Api_Solr_Service.php b/modules/pantheon/pantheon_apachesolr/Pantheon_Search_Api_Solr_Service.php index 2405821c159..cbf8f08b917 100644 --- a/modules/pantheon/pantheon_apachesolr/Pantheon_Search_Api_Solr_Service.php +++ b/modules/pantheon/pantheon_apachesolr/Pantheon_Search_Api_Solr_Service.php @@ -235,7 +235,7 @@ protected function performHttpRequest($method, $url, $timeout, $rawPost = NULL, list($result->protocol, $result->code, $result->status_message) = explode(' ', trim(array_shift($split)), 3); // Parse headers. $result->headers = array(); - while ($line = trim(array_shift($split))) { + while (!empty($split) && $line = trim(array_shift($split))) { list($header, $value) = explode(':', $line, 2); if (isset($result->headers[$header]) && $result->header == 'Set-Cookie') { // RFC 2109: the Set-Cookie response header comprises the token Set-