Ticket #5068: file_extension.patch

File file_extension.patch, 834 bytes (added by anongoblin, 9 years ago)

Fix

  • mediagoblin/media_types/__init__.py

    diff --git a/mediagoblin/media_types/__init__.py b/mediagoblin/media_types/__init__.py
    index 3eeead8..3d2c8fb 100644
    a b def get_media_type_and_manager(filename):  
    8484
    8585    This hook is deprecated, 'type_match_handler' should be used instead
    8686    '''
    87     if filename.find('.') > 0:
     87    if filename.find('.') >= 0:
    8888        # Get the file extension
    8989        ext = os.path.splitext(filename)[1].lower()
    9090
    def type_match_handler(media_file, filename):  
    106106    specifically. After that, if media type is one of supported ones, check the
    107107    contents of the file
    108108    '''
    109     if filename.find('.') > 0:
     109    if filename.find('.') >= 0:
    110110        # Get the file extension
    111111        ext = os.path.splitext(filename)[1].lower()