stupid_mime.php

This script is a poor substitute for a proper MIME type library.  If the server has mime_magic or finfo, these are used.  If not, LnBlog defaults to this.

This script does simple, brain-dead file extension checking.  It contains a list of known file extensions and corresponding MIME types and matches them up.  If a file uses a non-standard extension, then the reported MIME type will be wrong.

Functions
stupid_mime_get_type
function stupid_mime_get_type(
$filename
)

This just matches possible extensions on a file name to a MIME type.  This is totally the wrong way to do this, but writing a full MIME type library is outside the scope of this project.

stupid_mime_get_extensions
function stupid_mime_get_extensions(
$filename
)

This takes a filename and extracts a list of all possible file extensions.  This function supports stupid_mime_get_type.