bug: view.php mimetype with mixed case cause a script fault.

Joris Braakman jorisb@nl.euro.net
Mon, 19 Nov 2001 11:46:34 +0100


Hi,

This bug was found in a older version but by the looks of the code it is
still in there in a modified way. 

If a  mimetype with a mixed case is send it wil cause a script fault. A
example is the type "unknown" with is send by Pegasus mail as "Unknown".
The function strtolower can solve this.

patch (untested)

$ diff -u view.php view2.php 
--- view.php	Wed Jan 10 20:24:22 2001
+++ view2.php	Mon Nov 19 11:43:37 2001
@@ -47,7 +47,7 @@
      break;
      
  case DOWNLOAD_ATTACH:
-     header('Content-Type: application/x-unknown-' .  $mime_types[$mime->type] . '-' . $mime->subtype);
+     header('Content-Type: application/x-unknown-' .  $mime_types[strtolower($mime['type'])] . '-' . $mime['sub']);
      
      /* This should force a save file dialog.  According to a note
       * in MSDN, the suggested filename should NOT be in quotes.


Joris.