https://bugzilla.wikimedia.org/show_bug.cgi?id=44066

       Web browser: ---
            Bug ID: 44066
           Summary: Files cannot be uploaded when the database name
                    contains certain characters.
           Product: MediaWiki
           Version: 1.19.1
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: normal
          Priority: Unprioritized
         Component: Uploading
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected],
                    [email protected]
    Classification: Unclassified
   Mobile Platform: ---

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
sensitivity, and so I have gotten in the habit of naming my databases sensibly;
using a form such as "www.example.com-WikiDB".

Unfortunately doing something like this leaves it impossible to upload files,
despite the upload directory being writeable by the web-server. 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 problem, but I don't know whether this'd have implications. 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 regexp, and update if considered and found appropriate.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
You are the assignee for the bug.
You are watching all bug changes.
_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to