Skip to content

Commit 19c84e2

Browse files
committed
Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3: ext/gd: Fix comparison with result of php_stream_can_cast()
2 parents 3da9478 + 83b8d2c commit 19c84e2

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ PHP NEWS
1515
- FTP:
1616
. Fix theoretical issues with hrtime() not being available. (nielsdos)
1717

18+
- GD:
19+
. Fix incorrect comparison with result of php_stream_can_cast(). (Girgias)
20+
1821
- Hash:
1922
. Fix crash on clone failure. (nielsdos)
2023

ext/gd/gd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1610,7 +1610,7 @@ static void _php_image_create_from(INTERNAL_FUNCTION_PARAMETERS, int image_type,
16101610
pefree(pstr, 1);
16111611
zend_string_release_ex(buff, 0);
16121612
}
1613-
else if (php_stream_can_cast(stream, PHP_STREAM_AS_STDIO)) {
1613+
else if (php_stream_can_cast(stream, PHP_STREAM_AS_STDIO) == SUCCESS) {
16141614
/* try and force the stream to be FILE* */
16151615
if (FAILURE == php_stream_cast(stream, PHP_STREAM_AS_STDIO | PHP_STREAM_CAST_TRY_HARD, (void **) &fp, REPORT_ERRORS)) {
16161616
goto out_err;

0 commit comments

Comments
 (0)