]> git.mxchange.org Git - quix0rs-gnu-social.git/commit
Enhanced upload file type detection. If given an original filename, we'll attempt...
authorBrion Vibber <brion@pobox.com>
Mon, 10 May 2010 23:18:29 +0000 (16:18 -0700)
committerBrion Vibber <brion@pobox.com>
Mon, 28 Jun 2010 15:59:47 +0000 (08:59 -0700)
commit9c7b66984c46668f314f93337d28c62854b6d134
tree75c9c75503803f8d863a7bd04f33c2f139a37849
parent41d81b996fdd8276cc04e750297a12f852a97bf4
Enhanced upload file type detection. If given an original filename, we'll attempt to detect type from the extension if we were unable to make a definitive match from content. Generic octet-stream, zip, and MS Office type are explicitly singled out for re-checks, which fixes OpenOffice and MS Office documents to come up with the proper types when misdetected.
File extensions can also be added to the upload type whitelist; they'll be normalized to types for the actual comparison, so only known extensions will work.
lib/mediafile.php
tests/MediaFileTest.php
tests/sample-uploads/image.gif [new file with mode: 0644]
tests/sample-uploads/image.jpeg [new file with mode: 0644]
tests/sample-uploads/image.jpg [new file with mode: 0644]
tests/sample-uploads/image.png [new file with mode: 0644]