Commit 318f49fa authored by Andreas Fernandez's avatar Andreas Fernandez Committed by Helmut Hummel
Browse files

[BUGFIX] Check $http_response_headers in GeneralUtility::getUrl()

If one queries a local, non-existing file with GeneralUtility::getUrl()
AND sets the $report parameter, implode() fails because
$http_response_headers remains NULL, as there is no HTTP request.
Check the existance of $http_response_headers and alternatively use the
URL for logging.

Resolves: #67383
Releases: master, 6.2
Change-Id: I796935fbef090061c7d12502593190f4223765b3
Reviewed-on: http://review.typo3.org/40142


Reviewed-by: Xavier Perseguers's avatarXavier Perseguers <xavier@typo3.org>
Tested-by: Xavier Perseguers's avatarXavier Perseguers <xavier@typo3.org>
Reviewed-by: Nicole Cordes's avatarNicole Cordes <typo3@cordes.co>
Tested-by: Nicole Cordes's avatarNicole Cordes <typo3@cordes.co>
Reviewed-by: default avatarHelmut Hummel <helmut.hummel@typo3.org>
Tested-by: default avatarHelmut Hummel <helmut.hummel@typo3.org>
parent 20f616df
......@@ -2489,7 +2489,7 @@ Connection: close
$content = @file_get_contents($url, FALSE, $ctx);
if ($content === FALSE && isset($report)) {
$report['error'] = -1;
$report['message'] = 'Couldn\'t get URL: ' . implode(LF, $http_response_header);
$report['message'] = 'Couldn\'t get URL: ' . (isset($http_response_header) ? implode(LF, $http_response_header) : $url);
}
} else {
if (isset($report)) {
......@@ -2498,7 +2498,7 @@ Connection: close
$content = @file_get_contents($url);
if ($content === FALSE && isset($report)) {
$report['error'] = -1;
$report['message'] = 'Couldn\'t get URL: ' . implode(LF, $http_response_header);
$report['message'] = 'Couldn\'t get URL: ' . (isset($http_response_header) ? implode(LF, $http_response_header) : $url);
}
}
return $content;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment