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-