ext/curl: curl_error using curl_easy_strerror if CURLOPT_ERRORBUFFER

did not fill the error buffer.

close GH-14984
This commit is contained in:
David Carlier 2024-07-16 19:55:04 +01:00
parent 911dc5b46c
commit efd00b8ff0
No known key found for this signature in database
GPG key ID: D308BD11AB42D054
2 changed files with 9 additions and 1 deletions

4
NEWS
View file

@ -2,6 +2,10 @@ PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? ????, PHP 8.2.23
- Curl:
. Fixed case when curl_error returns an empty string.
(David Carlier)
- Soap:
. Fixed bug #55639 (Digest autentication dont work). (nielsdos)

View file

@ -2764,7 +2764,11 @@ PHP_FUNCTION(curl_error)
if (ch->err.no) {
ch->err.str[CURL_ERROR_SIZE] = 0;
RETURN_STRING(ch->err.str);
if (strlen(ch->err.str) > 0) {
RETURN_STRING(ch->err.str);
} else {
RETURN_STRING(curl_easy_strerror(ch->err.no));
}
} else {
RETURN_EMPTY_STRING();
}