See #159
This is a simple regular expression: '/^(\.|\h)*/m' It will match any combination of dots and horizontal spaces from the beginning. To be extra safe, after cleaning we check if anything is left and if not we actually default the the URL given name...
I only do this for Names provided by a header/remove HTTP idea. If a user decides to use local filenames or S3 ones, we don't want to modify their names at all (like really) and again, good practices are not something we SHOULD enforce via code. This is a way of getting around the strange filenames we are getting from remote sources.
See #159 This is a simple regular expression:
'/^(\.|\h)*/m'
It will match any combination ofdots
and horizontal spaces from the beginning. To be extra safe, after cleaning we check if anything is left and if not we actually default the the URL given name...I only do this for Names provided by a header/remove HTTP idea. If a user decides to use local filenames or S3 ones, we don't want to modify their names at all (like really) and again, good practices are not something we SHOULD enforce via code. This is a way of getting around the strange filenames we are getting from remote sources.
Relates to https://github.com/esmero/strawberryfield/pull/266 which deals with actual filenames that have dots