Merge branch 'PHP-8.0'

* PHP-8.0:
  Fix bug #81265: getimagesize returns 0 for 256px ICO images
This commit is contained in:
Nikita Popov 2021-07-16 10:07:35 +02:00
commit f2e374c881
3 changed files with 32 additions and 0 deletions

View File

@ -1099,6 +1099,12 @@ static struct gfxinfo *php_handle_ico(php_stream * stream)
num_icons--;
}
if (0 == result->width)
result->width = 256;
if (0 == result->height)
result->height = 256;
return result;
}
/* }}} */

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

View File

@ -0,0 +1,26 @@
--TEST--
GetImageSize() for ico format with 256px height
--FILE--
<?php
echo "*** Testing getimagesize() : 256px ico ***\n";
var_dump(getimagesize(__DIR__ . "/32x256.ico"));
?>
===DONE===
--EXPECT--
*** Testing getimagesize() : 256px ico ***
array(6) {
[0]=>
int(32)
[1]=>
int(256)
[2]=>
int(17)
[3]=>
string(23) "width="32" height="256""
["bits"]=>
int(8)
["mime"]=>
string(24) "image/vnd.microsoft.icon"
}
===DONE===