mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +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:
parent
911dc5b46c
commit
efd00b8ff0
2 changed files with 9 additions and 1 deletions
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue