1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

fileinfo: Show libmagic version with . in PHPInfo output (#18399)

This makes the output in PHPInfo a little more readable.
This commit is contained in:
Tim Düsterhus
2025-04-23 16:21:13 +02:00
committed by GitHub
parent 7e15a07fea
commit 00affe43aa

View File

@@ -115,10 +115,10 @@ ZEND_GET_MODULE(fileinfo)
/* {{{ PHP_MINFO_FUNCTION */
PHP_MINFO_FUNCTION(fileinfo)
{
char magic_ver[5];
char magic_ver[15];
(void)snprintf(magic_ver, 4, "%d", magic_version());
magic_ver[4] = '\0';
int raw_version = magic_version();
(void)snprintf(magic_ver, sizeof(magic_ver), "%d.%d", raw_version / 100, raw_version % 100);
php_info_print_table_start();
php_info_print_table_row(2, "fileinfo support", "enabled");