Hi all:
I yesterday upgraded to WordPress 3.3.1, and ever since, when I access the Media Library in the admin page, I get this warning near every video file I have uploaded:
Warning: in_array() [function.in-array]: Wrong datatype for second argument\n
in [path to my wordpress installation]/wp-includes/functions.php on line 2447
That line belongs to the function wp_ext2type(), and it compares a file extension to an array of authorized extensions. I finally managed to trace this error to the fact that, when called to check a video file, the second argument passed to it isn’t an array, but the string “video/webm”…
…which happens to be added by the “minimatica_mime_types()” function to the list of allowed MIME types. I added some debugging code to that function, and the array $types that this function receives is of the form:
'audio' => ('ac3', 'aif'...),
'video' => ('avi', 'mpg', 'mov')
So one could certainly see how just adding:
$types['webm'] = 'video/webm';
Like the Minimatica function does, could add the wrong data to the format… And yet:
1) The WordPress documentation says that the above is exactly the way to go to add new MIME types.
2) The error happens in the wp_ext2type() function, which has nothing to do with MIME types. (I added some debugging code to minimatica_file_types(), and it never got called).
3) This error does NOT happen in my development machine, which runs PHP 5.3.5. It only happens in the server, which is running PHP 5.2.17.
I know there’s an easy workaround for this (disable that function), but I can’t help but wonder: is this a bug with Minimatica, or with WordPress? What’s going on?