file extension bug + patch

Ahmed <[email protected]>
Newsgroups gmane.comp.horde.chora
Message-ID <[email protected]>
Found a small bug that was preventing files like .c and .vhd from being
identified correctly in chora (latest CVS today).

Instead of identifying them as text and using the appropriate source
colouring tool they where identified as octet-stream and downloaded instead
of viewed.

anyway it turns out to be a trivial bug in /lib/MIME/Magic.php

--snip
*** Magic.php   Sat Oct 18 14:59:22 2003
--- Magic.php.new       Sat Oct 18 14:57:57 2003
***************
*** 105,111 ****
          $pos = strrpos($filename, '.');
          if (!empty($pos)) {
              $type = MIME_Magic::extToMIME(substr($filename, $pos + 1));
!             if (!stristr($type, 'x-extension')) {
                  return $type;
              }
          }
--- 105,111 ----
          $pos = strrpos($filename, '.');
          if (!empty($pos)) {
              $type = MIME_Magic::extToMIME(substr($filename, $pos + 1));
!             if (stristr($type, 'x-extension')) {
                  return $type;
              }
          }

--snip

Ahmed...




-- 
Chora mailing list
Frequently Asked Questions: http://horde.org/faq/
To unsubscribe, mail: [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.