Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #39550, comment 52


Ignore:
Timestamp:
01/15/2017 11:32:22 PM (7 years ago)
Author:
blobfolio
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #39550, comment 52

    initial v1  
    55Maybe something like this should be integrated to provide more robust file type validation handling? I don't think the behaviors in the main WordPress MIME/type functions should change (at least not without a flag or filter to preserve backward compatibility), but the validation performed in `wp_check_filetype_and_ext()` could be improved to better work with the range of content users might upload.
    66
    7 The \blobmimes\file() helper provides "magic" `finfo` analysis and suggested alternative file names when there is a mismatch. Seems like non-image files should be renamed as well to give their "true" type a chance to pass the `upload_mimes` test.
     7The `\blobmimes\file()` helper provides "magic" `finfo` analysis and suggested alternative file names when there is a mismatch. Seems like non-image files should be renamed as well to give their "true" type a chance to pass the `upload_mimes` test.
    88
    99Example file info: https://github.com/Blobfolio/blob-mimes/blob/master/docs/FILE.md#example
    1010Example MIME types by extension: https://github.com/Blobfolio/blob-mimes/blob/master/docs/EXTENSION.md#example
    1111
    12 The \blobmimes\extension()->has_mime() method also provides soft matching of "x-" type variants, which should help catch some additional outliers.
     12The `\blobmimes\extension()->has_mime()` method also provides soft matching of "x-" type variants, which should help catch some additional outliers.
    1313
    1414Any thoughts or suggestions welcome!