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.
function stupid_mime_get_type( |
| ) |
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.
function stupid_mime_get_extensions( |
| ) |
This takes a filename and extracts a list of all possible file extensions. This function supports stupid_mime_get_type.