1
0
mirror of https://github.com/php/php-src.git synced 2026-04-29 19:23:22 +02:00

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
2 changed files with 9 additions and 1 deletions
+4
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)
+5 -1
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();
}