We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 219d9fe commit e104115Copy full SHA for e104115
src/Stream.php
@@ -370,9 +370,14 @@ private function setStream($stream, string $mode = 'r') : void
370
*/
371
private function isValidStreamResourceType($resource): bool
372
{
373
- return (
374
- is_resource($resource) &&
375
- in_array(get_resource_type($resource), self::ALLOWED_STREAM_RESOURCE_TYPES, true)
376
- );
+ if (is_resource($resource)) {
+ return in_array(get_resource_type($resource), self::ALLOWED_STREAM_RESOURCE_TYPES, true);
+ }
+
377
+ if (PHP_VERSION_ID >= 80000 && $resource instanceof \GdImage) {
378
+ return true;
379
380
381
+ return false;
382
}
383
0 commit comments