php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #60129
Patch curl_capath_ini.patch revision 2011-10-25 12:52 UTC by dominic dot benson at thirdlight dot com

Patch curl_capath_ini.patch for cURL related Bug #60129

Patch version 2011-10-25 12:52 UTC

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

Developer: dominic.benson@thirdlight.com

diff -rupN php-5.3.8.orig/ext/curl/interface.c php-5.3.8/ext/curl/interface.c
--- php-5.3.8.orig/ext/curl/interface.c	2011-07-28 11:31:34.000000000 +0100
+++ php-5.3.8/ext/curl/interface.c	2011-10-25 13:06:34.000000000 +0100
@@ -334,6 +334,7 @@ ZEND_GET_MODULE (curl)
 /* {{{ PHP_INI_BEGIN */
 PHP_INI_BEGIN()
 	PHP_INI_ENTRY("curl.cainfo", "", PHP_INI_SYSTEM, NULL)
+	PHP_INI_ENTRY("curl.capath", "", PHP_INI_SYSTEM, NULL)
 PHP_INI_END()
 /* }}} */
 
@@ -1450,6 +1451,7 @@ PHP_FUNCTION(curl_init)
 	char		*url = NULL;
 	int		url_len = 0;
 	char *cainfo;
+	char *capath;
 
 	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &url, &url_len) == FAILURE) {
 		return;
@@ -1495,6 +1497,10 @@ PHP_FUNCTION(curl_init)
 	if (cainfo && strlen(cainfo) > 0) {
 		curl_easy_setopt(ch->cp, CURLOPT_CAINFO, cainfo);
 	}
+	capath = INI_STR("curl.capath");
+	if (capath && strlen(capath) > 0) {
+		curl_easy_setopt(ch->cp, CURLOPT_CAPATH, capath);
+	}
 
 #if defined(ZTS)
 	curl_easy_setopt(ch->cp, CURLOPT_NOSIGNAL, 1);
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 21:01:28 2024 UTC