**Author:** `grotlek`
**Description:**
This problem took me a LONG time debugging using var_dump to get to the bottom of, but here goes..
My database backend (pgsql) allows database names containing . and case sensitivityThe default upload directory contains the database name, and so I have gotten in the habit of naming my databases sensibly;is validated by `FileBackendStore::isValidContainerName()` which only allows alphanumberic characters, using a form such as "www.example.com-WikiDB".
Unfortunately doing something like this leaves it impossible to upload files`-` and `_`, despite the upload directory being writeable by the web-serverso any other character in the database name breaks uploads completely and results in an error message saying `Could not create directory "mwstore://local-backend/local-public/<path>"`. A very obscure error message ("Could not create directory "mwstore://local-backend/local-public/(etc)") is shown.
I traced the "fault" to a regular expression match in the function isValidContainerName() in mediawiki/includes/filerepo/backend/FileBackend.php.
Modifying the regular expression so it allowed uppercase and the dot character fixed my problemThe dot character (disallowed, but I don't know whether this'd have implications.apparently, I changed the part inside [] to be [a-zA-Z0-9][a-zA-Z0-9-_.] (rest of regex left unchanged).
I recommend someone consider the reason for certain characters (uppercase, period - possibly others) which are valid in database names being invalid in this regexpfor Swift compatibility) especially is a common pain point since databases are sometimes named after domain names.
The container name is generated from the DB name in `FileBackendStore::fullContainerName()`, and update if considered and found appropriate.
--------------------------
**Version**: 1.19.1
**Severity**: normalso invalid characters should probably be escaped there.