From 975b034f502ecc5617c9b9366e57d17f53567f00 Mon Sep 17 00:00:00 2001 From: Jamie Cameron Date: Fri, 5 Oct 2007 19:39:08 +0000 Subject: [PATCH] Nicer MIME type names --- web-lib-funcs.pl | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/web-lib-funcs.pl b/web-lib-funcs.pl index 380fbb166..c4984c8fa 100755 --- a/web-lib-funcs.pl +++ b/web-lib-funcs.pl @@ -5390,11 +5390,17 @@ if (!@list_mime_types_cache) { local $_; open(MIME, "$root_directory/mime.types"); while() { + local $cmt; s/\r|\n//g; - s/#.*$//g; + if (s/#\s*(.*)$//g) { + $cmt = $1; + } local ($type, @exts) = split(/\s+/); - push(@list_mime_types_cache, { 'type' => $type, - 'exts' => \@exts }); + if ($type) { + push(@list_mime_types_cache, { 'type' => $type, + 'exts' => \@exts, + 'desc' => $cmt }); + } } close(MIME); }