[BUGFIX] Filter http/verify option for guzzle to boolean 98/53698/3
authorWolfgang Klinger <wolfgang@wazum.com>
Mon, 7 Aug 2017 06:30:26 +0000 (08:30 +0200)
committerBenni Mack <benni@typo3.org>
Mon, 14 Aug 2017 19:56:08 +0000 (21:56 +0200)
guzzle expects a real boolean value.
This fix filters the given verify option to either the boolean
equivalent or leaves any other string (path to certificate) as is.

Resolves: #78729
Releases: master, 8.7
Change-Id: I3cc74692303e74b724683e54edad10ecb37e75c7
Reviewed-on: https://review.typo3.org/53698
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
typo3/sysext/core/Classes/Http/RequestFactory.php

index b7a8e19..5bfe197 100644 (file)
@@ -45,6 +45,9 @@ class RequestFactory
      */
     protected function getClient(): ClientInterface
     {
-        return GeneralUtility::makeInstance(Client::class, $GLOBALS['TYPO3_CONF_VARS']['HTTP']);
+        $httpOptions = $GLOBALS['TYPO3_CONF_VARS']['HTTP'];
+        $httpOptions['verify'] = filter_var($httpOptions['verify'], FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE) ?? $httpOptions['verify'];
+
+        return GeneralUtility::makeInstance(Client::class, $httpOptions);
     }
 }