php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login

Patch 0001-report-warning-only-if-the-global-cache-mode-should-.patch for cURL related Bug #75751

Patch version 2018-01-02 09:27 UTC

Return to Bug #75751 | Download this patch
Patch Revisions:

Developer: pavel.madr@gmail.com

From a7fe6f8dd785ad5008083a311f6a7159b2a71dc2 Mon Sep 17 00:00:00 2001
From: Pavel Madr <pavel.madr@gmail.com>
Date: Tue, 2 Jan 2018 08:19:11 +0100
Subject: [PATCH] report warning only if the global cache mode should be
 enabled

---
 ext/curl/interface.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ext/curl/interface.c b/ext/curl/interface.c
index c804986..f347d4b 100644
--- a/ext/curl/interface.c
+++ b/ext/curl/interface.c
@@ -2283,7 +2283,7 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue) /* {{{
 			}
 #endif
 # if defined(ZTS)
-			if (option == CURLOPT_DNS_USE_GLOBAL_CACHE) {
+			if (option == CURLOPT_DNS_USE_GLOBAL_CACHE && lval) {
 				php_error_docref(NULL, E_WARNING, "CURLOPT_DNS_USE_GLOBAL_CACHE cannot be activated when thread safety is enabled");
 				return 1;
 			}
-- 
2.7.4

 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Wed Jun 03 20:01:26 2020 UTC