Commit 5af25891 authored by Christoph Kratz's avatar Christoph Kratz Committed by Nicole Cordes
Browse files

[BUGFIX] Catch RequestException in GeneralUtility::getUrl()

When a request in getUrl() fails (e.g. due to exceeded time limit, host
misconfiguration) Guzzle throws an exception.

This patch restores the behaviour of getUrl() before using Guzzle by
catching the exception.

Resolves: #75757
Releases: master
Change-Id: Iedc36cce48eaee85beeb7c448b546dc3a49034d0
Reviewed-on: https://review.typo3.org/47779


Reviewed-by: Wouter Wolters's avatarWouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Philipp Gampe's avatarPhilipp Gampe <philipp.gampe@typo3.org>
Tested-by: Philipp Gampe's avatarPhilipp Gampe <philipp.gampe@typo3.org>
Reviewed-by: Nicole Cordes's avatarNicole Cordes <typo3@cordes.co>
Tested-by: Nicole Cordes's avatarNicole Cordes <typo3@cordes.co>
parent 511dc242
......@@ -14,6 +14,7 @@ namespace TYPO3\CMS\Core\Utility;
* The TYPO3 project - inspiring people to share!
*/
use GuzzleHttp\Exception\RequestException;
use TYPO3\CMS\Core\Charset\CharsetConverter;
use TYPO3\CMS\Core\Core\ApplicationContext;
use TYPO3\CMS\Core\Core\ClassLoadingInformation;
......@@ -2025,7 +2026,19 @@ class GeneralUtility
$configuration = [];
}
$response = $requestFactory->request($url, 'GET', $configuration);
try {
if (isset($report)) {
$report['lib'] = 'GuzzleHttp';
}
$response = $requestFactory->request($url, 'GET', $configuration);
} catch (RequestException $exception) {
if (isset($report)) {
$report['error'] = $exception->getHandlerContext()['errno'];
$report['message'] = $exception->getMessage();
}
return false;
}
$content = '';
// Add the headers to the output
......
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