Permalink
Browse files

Fixes issue 250

git-svn-id: http://django-filebrowser.googlecode.com/svn/trunk@561 b1eb0509-c838-0410-b15c-e5ce2c1b85ca
  • Loading branch information...
1 parent c12bb16 commit 5ee0c12f414b47309d19abe49c2370540dd6929f klemens.mantzos committed Mar 12, 2010
Showing with 4 additions and 3 deletions.
  1. +2 −3 filebrowser/forms.py
  2. +2 −0 filebrowser/settings.py
@@ -9,11 +9,10 @@
from django.utils.translation import ugettext as _
# filebrowser imports
-from filebrowser.settings import MAX_UPLOAD_SIZE
+from filebrowser.settings import MAX_UPLOAD_SIZE, FOLDER_REGEX
from filebrowser.functions import convert_filename
-alnum_name_re = re.compile(r'^[\sa-zA-Z0-9._/-]+$')
-
+alnum_name_re = re.compile(FOLDER_REGEX)
class MakeDirForm(forms.Form):
"""
@@ -108,6 +108,8 @@
DEFAULT_SORTING_BY = getattr(settings, "FILEBROWSER_DEFAULT_SORTING_BY", "date")
# Sorting Order: asc, desc
DEFAULT_SORTING_ORDER = getattr(settings, "FILEBROWSER_DEFAULT_SORTING_ORDER", "desc")
+# regex to clean dir names before creation
+FOLDER_REGEX = getattr(settings, "FILEBROWSER_FOLDER_REGEX", r'^[\sa-zA-Z0-9._/-]+$')
# EXTRA TRANSLATION STRINGS
# The following strings are not availabe within views or templates

0 comments on commit 5ee0c12

Please sign in to comment.