sehmaschine/django-filebrowser — pull request #177 by gorghoa (2013-07-04 07:47:07+00:00)
Title: Update sites.py

This simple patch should correct the following behaviour :

Currently, a filename like my_bigbrother.pdf got filtered in the browse view, because the regex matches it as a file version of my.pdf

This is due to the default extension for folder which is an empty string, so the filtering regex pattern looks like:

#_big(|.pdf|.txt|.jpg|.etcaetera)#

Note the first | in the regex => it is the empty string representing folders extension.

So, the regex is useless, it is somewhat equivalent to:

#_big#

My patch simply propose to add the end string delimiter $, so pattern will look like this:

#_big(|.pdf|.txt|.jpg|.etcaetera)$#

Then, my_bigbrother.pdf will not be filtered, but my_bigbrother_big.pdf, will.

regards.
Rodrigue