|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2015-03-12 20:55 UTC] ab@php.net
-Status: Open
+Status: Not a bug
[2015-03-12 20:55 UTC] ab@php.net
[2015-03-16 19:29 UTC] weierophinney@php.net
-Status: Not a bug
+Status: Re-Opened
[2015-03-16 19:29 UTC] weierophinney@php.net
[2016-08-26 13:12 UTC] cmb@php.net
-Package: Filesystem function related
+Package: Unknown/Other Function
[2016-08-26 13:12 UTC] cmb@php.net
[2021-08-03 12:39 UTC] cmb@php.net
-Status: Re-Opened
+Status: Feedback
-Assigned To:
+Assigned To: cmb
[2021-08-03 12:39 UTC] cmb@php.net
[2021-08-03 13:22 UTC] weierophinney@php.net
[2021-08-03 13:25 UTC] cmb@php.net
-Status: Feedback
+Status: Closed
[2021-08-03 13:25 UTC] cmb@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Nov 04 16:00:01 2025 UTC |
Description: ------------ We're testing ZF2 against PHP7 nightly. In the last couple days, we started noticing that our tests that use a magic.mime file started failing, with messages of the format "finfo_open(): Warning: Printf format `l' is not valid for type `lequad' in description `...'". From what I can see, recent changes to ext/fileinfo/libmagic/ have removed support for the following printf sequences: * l, ll, h, and hh (used as length modifiers) * .0 (used to indicate zero-padding vs space padding) * numeric precision This is particularly problematic, as the lequad and bequad libmagic specifications require specific formats that require such modifiers, and without the above, there is no way to provide a valid magic.mime file to finfo_open(). Researching libmagic, I cannot find a magic.mime file that does NOT have these formats present. Test script: --------------- <?php $magicData = file_get_contents('https://raw.githubusercontent.com/zendframework/zf2/2750340ad353cad9e80525d1c13efcda03e21027/tests/ZendTest/Validator/File/_files/magic.mime'); $magicFile = tempnam(sys_get_temp_dir(), 'mag'); file_put_contents($magicFile, $magicData); finfo_open(FILEINFO_MIME_TYPE, $magicFile); Actual result: -------------- ErrorException: finfo_open(): Failed to load magic database at '...'. Caused by ErrorException: finfo_open(): Warning: Printf format `h' is not valid for type `leshort' in description `.%hd' // and many, many more similar errors