[BUGFIX] Treat empty responses as error in GeneralUtility::getUrl 47/56047/2
authorFelix Buenemann <felix.buenemann@gmail.com>
Wed, 7 Mar 2018 20:51:52 +0000 (21:51 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Thu, 8 Mar 2018 01:58:53 +0000 (02:58 +0100)
This fixes a negation bug introduced when the GeneralUtility::getUrl
code was converted to use GuzzleHttp instead of cURL.

Also updated ErrorController test doubles that where asserting the
wrong behavior.

Resolves: #84167
Releases: master, 8.7
Change-Id: I9b8982dc34f8a4ac22769beb7f837f090ce73f23
Reviewed-on: https://review.typo3.org/56047
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/core/Classes/Utility/GeneralUtility.php

index 6134e6b..ccf86d1 100644 (file)
@@ -2086,7 +2086,7 @@ class GeneralUtility
                     $report['content_type'] = $response->getHeader('Content-Type');
                     $report['error'] = $response->getStatusCode();
                     $report['message'] = $response->getReasonPhrase();
-                } elseif (!empty($content)) {
+                } elseif (empty($content)) {
                     $report['error'] = $response->getStatusCode();
                     $report['message'] = $response->getReasonPhrase();
                 } elseif ($includeHeader) {