Skip to content

Commit 223683d

Browse files
committed
Merge branch 'PHP-8.3'
2 parents c550d34 + 383d1b0 commit 223683d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

ext/curl/interface.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2626,7 +2626,11 @@ PHP_FUNCTION(curl_error)
26262626

26272627
if (ch->err.no) {
26282628
ch->err.str[CURL_ERROR_SIZE] = 0;
2629-
RETURN_STRING(ch->err.str);
2629+
if (strlen(ch->err.str) > 0) {
2630+
RETURN_STRING(ch->err.str);
2631+
} else {
2632+
RETURN_STRING(curl_easy_strerror(ch->err.no));
2633+
}
26302634
} else {
26312635
RETURN_EMPTY_STRING();
26322636
}

0 commit comments

Comments
 (0)