[BUGFIX] Check curl availability before using it
authorTolleiv Nietsch <info@tolleiv.de>
Tue, 13 Sep 2011 11:47:08 +0000 (13:47 +0200)
committerJigal van Hemert <jigal@xs4all.nl>
Fri, 16 Sep 2011 11:32:33 +0000 (13:32 +0200)
Curl is used when activated in the install tool.
The core should check if curl is available before using it.

Because the getUrl() refactoring will hopefully be ready in 4.7,
I found that this simple solution should at least fix it for 4.6.

Change-Id: I29e4d3b760aaf09f95a2ba6f560fe6562a7d5310
Resolves: #24984
Branches: 4.6, 4.5
Reviewed-on: http://review.typo3.org/4956
Reviewed-by: Xavier Perseguers
Tested-by: Xavier Perseguers
Reviewed-by: Jigal van Hemert
Tested-by: Jigal van Hemert
t3lib/class.t3lib_div.php

index 187108c..30a27b3 100644 (file)
@@ -2551,8 +2551,7 @@ final class t3lib_div {
                        }
 
                                // External URL without error checking.
-                       $ch = curl_init();
-                       if (!$ch) {
+                       if (!function_exists('curl_init') || !($ch = curl_init())) {
                                if (isset($report)) {
                                        $report['error'] = -1;
                                        $report['message'] = 'Couldn\'t initialize cURL.';