I recently upgraded a MediaWiki from the 1.15 era to 1.24.2. Most things worked fine, however, all
previously existing thumbnails failed to appear, with errors indicating that the file was missing.
When MediaWiki tried to recreate the thumbnails, it also claimed that it was unable to find the
local sources for them. Debugging indicates that the mwstore:// URLs for the thumbnails are
not being converted into local filesystem paths (false ends up being returned).
A colleague has identified that the problem is in the file includes/filebackend/FileBackendStore.php
in the function isValidContainerName where it checks the container name against the following regex:
return preg_match( '/^[a-z0-9][a-z0-9-_]{0,199}$/i', $container );
My database name has a plus sign ('+') in it. This is valid in MySQL, and is required by my
hosting provider. Apparently back around MediaWiki 1.17, it was errantly thought that a plus
sign was not valid in a DB name, and that was later corrected in most places, but this
regex was missed. I'm not sure if there are other characters that cause this problem.
Steps to reproduce:
1) Install MW 1.15
2) Upload some files, include some thumbnails in a couple pages
3) Upgrade to MW 1.24.2
4) Notice that thumbnails have disappeared and can't be regenerated
This also probably happens with a fresh install and likely breaks uploads.
Adding the plus sign to the above regex remedies the problem.