diff options
| -rw-r--r-- | NEWS | 1 | ||||
| -rw-r--r-- | UPGRADING | 6 | ||||
| -rw-r--r-- | ext/curl/interface.c | 43 |
3 files changed, 8 insertions, 42 deletions
@@ -30,6 +30,7 @@ PHP NEWS - CURL: . Fixed bug #71709 (curl_setopt segfault with empty CURLOPT_HTTPHEADER). (Pierrick) + . Fixed bug #71929 (CURLINFO_CERTINFO data parsing error). (Pierrick) - Date: . Fixed bug #66836 (DateTime::createFromFormat 'U' with pre 1970 dates fails @@ -442,6 +442,8 @@ Other - Curl: . Removed support for disabling the CURLOPT_SAFE_UPLOAD option. All curl file uploads must use the curl_file / CURLFile APIs. + . curl_getinfo($ch, CURLINFO_CERTINFO) returns certificate Subject and Issuer + as a string (PHP >= 5.6.25) - Date: . Removed $is_dst parameter from mktime() and gmmktime(). @@ -821,3 +823,7 @@ out, that the corresponding SDK isn't available anymore. of aditional information with internal functions. In PHP-5 it was possible to use zend_function.op_array.reserved[] even for internal functions, but now we don't allocate extra space. + +- CURL + . curl_getinfo($ch, CURLINFO_CERTINFO) returns certificate Subject and Issuer + as a string (PHP >= 7.0.10) diff --git a/ext/curl/interface.c b/ext/curl/interface.c index 648d8ce607..be15785cd0 100644 --- a/ext/curl/interface.c +++ b/ext/curl/interface.c @@ -1876,38 +1876,6 @@ static php_curl *alloc_curl_handle() /* }}} */ #if LIBCURL_VERSION_NUM >= 0x071301 /* Available since 7.19.1 */ -/* {{{ split_certinfo - */ -static void split_certinfo(char *string, zval *hash) -{ - char *org = estrdup(string); - char *s = org; - char *split; - - if(org) { - do { - char *key; - char *val; - char *tmp; - - split = strstr(s, "; "); - if(split) - *split = '\0'; - - key = s; - tmp = memchr(key, '=', 64); - if(tmp) { - *tmp = '\0'; - val = tmp+1; - add_assoc_string(hash, key, val); - } - s = split+2; - } while(split); - efree(org); - } -} -/* }}} */ - /* {{{ create_certinfo */ static void create_certinfo(struct curl_certinfo *ci, zval *listcode) @@ -1930,16 +1898,7 @@ static void create_certinfo(struct curl_certinfo *ci, zval *listcode) if(tmp) { *tmp = '\0'; len = strlen(s); - if (!strcmp(s, "Subject") || !strcmp(s, "Issuer")) { - zval hash; - - array_init(&hash); - - split_certinfo(&slist->data[len+1], &hash); - add_assoc_zval(&certhash, s, &hash); - } else { - add_assoc_string(&certhash, s, &slist->data[len+1]); - } + add_assoc_string(&certhash, s, &slist->data[len+1]); } else { php_error_docref(NULL, E_WARNING, "Could not extract hash key from certificate info"); } |
