fix all problems I could see with dirs/filenames containing spaces/accented chars...
[booh] / lib / booh / booh-lib.rb
index 8613df9e51b68d99f59d2646804eebe8f5a33318..464fe77dae1be01217613e667b7e7003d5c254ac 100644 (file)
@@ -115,9 +115,9 @@ module Booh
     end
 
     def entry2type(entry)
-        if entry =~ /\.(jpg|jpeg|jpe|gif|bmp|png)$/i
+        if entry =~ /\.(jpg|jpeg|jpe|gif|bmp|png)$/i && entry !~ /['"\(\)\[\]]/
             return 'image'
-        elsif entry =~ /\.(mov|avi|mpg|mpeg|mpe|wmv|asx)$/i
+        elsif entry =~ /\.(mov|avi|mpg|mpeg|mpe|wmv|asx)$/i && entry !~ /['"\(\)\[\]]/
             #- might consider using file magic later..
             return 'video'
         else