From e8acd28f078cc1f53f63ac476340b2432319fb11 Mon Sep 17 00:00:00 2001 From: Diederik van der Boor Date: Wed, 1 May 2013 11:07:32 +0200 Subject: [PATCH] Settings: escape extension dots in default EXCLUDE list, avoid empty entry. --- filebrowser/settings.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/filebrowser/settings.py b/filebrowser/settings.py index 640047f..5c0c833 100644 --- a/filebrowser/settings.py +++ b/filebrowser/settings.py @@ -3,6 +3,7 @@ # django imports from django.conf import settings from django.utils.translation import ugettext_lazy as _ +import re # PATH AND URL SETTINGS @@ -77,7 +78,7 @@ # Default is to exclude 'thumbnail' style naming of image-thumbnails. EXTENSION_LIST = [] for exts in EXTENSIONS.values(): - EXTENSION_LIST += exts + EXTENSION_LIST += [re.escape(ext) for ext in exts if ext] EXCLUDE = getattr(settings, 'FILEBROWSER_EXCLUDE', (r'_(%(exts)s)_.*_q\d{1,3}\.(%(exts)s)' % {'exts': ('|'.join(EXTENSION_LIST))},)) # Max. Upload Size in Bytes. MAX_UPLOAD_SIZE = getattr(settings, "FILEBROWSER_MAX_UPLOAD_SIZE", 10485760)