fix #116: cookies fail with libcurl >= 7.77
authorMichael Wallner <mike@php.net>
Mon, 2 Aug 2021 14:58:59 +0000 (16:58 +0200)
committerMichael Wallner <mike@php.net>
Tue, 3 Aug 2021 10:56:23 +0000 (12:56 +0200)
src/php_http_client_curl.c

index 89ae5e0bc03bccea4be56653fe0af8dce42e5f5c..0e79f197bd3255cda32398ea4ab0843f55811480 100644 (file)
@@ -856,7 +856,7 @@ static ZEND_RESULT_CODE php_http_curle_option_set_cookiestore(php_http_option_t
        } else {
                storage->cookiestore = NULL;
        }
-       if (    CURLE_OK != curl_easy_setopt(ch, CURLOPT_COOKIEFILE, storage->cookiestore)
+       if (    CURLE_OK != curl_easy_setopt(ch, CURLOPT_COOKIEFILE, storage->cookiestore ? storage->cookiestore : "")
                ||      CURLE_OK != curl_easy_setopt(ch, CURLOPT_COOKIEJAR, storage->cookiestore)
        ) {
                return FAILURE;