Commit d074df4c authored by Dries's avatar Dries

- Patch #1671200 by chx, sun, jaimealsilva: Fixed Simpletest broken on 5.4:...

- Patch #1671200 by chx, sun, jaimealsilva: Fixed Simpletest broken on 5.4: CURLOPT_COOKIEJAR cannot be NULL on php5-curl version 5.4.4.
parent 95866bce
......@@ -816,6 +816,13 @@ protected function curlInitialize() {
if (!isset($this->curlHandle)) {
$this->curlHandle = curl_init();
// Some versions/configurations of cURL break on a NULL cookie jar, so
// supply a real file.
if (empty($this->cookieFile)) {
$this->cookieFile = $this->public_files_directory . '/cookie.jar';
}
$curl_options = array(
CURLOPT_COOKIEJAR => $this->cookieFile,
CURLOPT_URL => $base_url,
......@@ -830,7 +837,12 @@ protected function curlInitialize() {
$curl_options[CURLOPT_HTTPAUTH] = $this->httpauth_method;
$curl_options[CURLOPT_USERPWD] = $this->httpauth_credentials;
}
curl_setopt_array($this->curlHandle, $this->additionalCurlOptions + $curl_options);
// curl_setopt_array() returns FALSE if any of the specified options
// cannot be set, and stops processing any further options.
$result = curl_setopt_array($this->curlHandle, $this->additionalCurlOptions + $curl_options);
if (!$result) {
throw new \UnexpectedValueException('One or more cURL options could not be set.');
}
// By default, the child session name should be the same as the parent.
$this->session_name = session_name();
......
Markdown is supported
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