Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 23, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions ext/fileinfo/fileinfo.c
Original file line numberDiff line numberDiff line change
Expand Up@@ -135,10 +135,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");
Expand Down
Loading
close