Gif is included by default and they are adding to the default values, so
gif is in there.

If a file extension didnt match the list it would still give a 200 status
code, just with an error message, and not a 404.

On Sunday, 4 May 2025, Jeffrey T. Darlington <[email protected]>
wrote:

> This is just a hunch, but $wgFileExtensions does not contain "gif" as an
> allowed extension for uploading.
>
> https://www.mediawiki.org/wiki/Manual:$wgFileExtensions
>
> On Sun, May 4, 2025 at 5:53 PM Christian Kujau <[email protected]>
> wrote:
>
>> Hello list,
>>
>> for some reason I'm no longer able to use the upload function on my
>> little
>> Mediawiki installation. I haven't uploaded things a while, and recently
>> updated to 1.43.1, and everything else appears to work quite well, except
>> uploads. So, I navigate to Special:Upload and in the Apache web server
>> log
>> I can see (shortened, w/o IP adresses and user information):
>>
>>  "GET /wiki/Special:Upload HTTP/2.0" 200 5795 "-" "Mozilla...
>>
>> Great, HTTP/200 looks good, and the "Upload file" page is being
>> displayed,
>> and I click on "choose file" and select a .gif and the .gif is displayed
>> now displayed as a little preview in the "Source file" part of the Upload
>> page. But then I hit the "Upload file" at the bottom of the page and get
>> a
>> "Not Found" message in my browser window. And the same Apache web server
>> log now has:
>>
>>  "POST /wiki/Special:Upload HTTP/2.0" 404 291 "
>> https://foo.example.org/wiki/Special:Upload"; "Mozilla...
>>
>> So, GET works just fine, but POST produces a HTTP/404?
>>
>> I've disabled mod_security, disabled all CSP and X-XSS-Protection etc.
>> headers too, but I'm at a loss on how to debug this further.
>>
>> In my virtual host configuration of the Apache web server, the following
>> is included:
>>
>>   RewriteRule ^/wiki/(.+)?$  /mediawiki/index.php [L]
>>
>> This worked quite well over the years, and I *was* able to upload stuff
>> before, and with that configuration too.
>>
>> Attached below is my (shortened) LocalSettings.php (w/o some database
>> secrets and names).
>>
>> Has anybody seen something like this before, and maybe even remembers
>> where to look to debug this?
>>
>> Thank you,
>> Christian.
>>
>> ===== LocalSettings.php
>> $wgSitename             = "foo";
>> $wgScriptPath           = "/mediawiki";         # real path
>> $wgArticlePath          = "/wiki/$1";           # virtual path
>> $wgUsePathInfo          = true;                 # ?
>> $wgServer               = "https://foo.example.org";;
>> $wgEnotifUserTalk       = true;         # UPO
>> $wgEnotifWatchlist      = true;         # UPO
>> $wgEmailAuthentication  = true;
>> $wgDBtype               = "mysql";
>> $wgDBserver             = "127.0.0.1";
>> $wgDBname               = "foo";
>> $wgDBuser               = "foo";
>> $wgDBpassword           = "xxxx";
>> $wgDBprefix             = "";
>> $wgMainCacheType                = CACHE_ACCEL;
>> $wgCachePages                   = true;
>> $wgParserCacheExpireTime        = 604800;
>> $wgUseFileCache                 = true;
>> $wgEnableSidebarCache           = true;
>> $wgShowIPinHeader               = false;
>> $wgEnableUploads                = true;
>> $wgUseImageMagick               = true;
>> $wgImageMagickConvertCommand    = "/usr/bin/convert";
>> $wgShellLocale                  = "en_US.utf8";
>> $wgCacheDirectory               = "$IP/cache";
>> $wgFileCacheDirectory           = "$wgCacheDirectory/html";
>> $wgLanguageCode         = "en";
>> $wgSecretKey = "xxxx";
>> $wgUpgradeKey           = "xxx";
>> $wgDefaultSkin          = "Vector";
>> $wgDiff3                = "/usr/bin/diff3";
>> $wgGroupPermissions['*']['read']                = true;
>> $wgGroupPermissions['*']['edit']                = false;
>> $wgGroupPermissions['*']['createaccount']       = false;
>> $wgNoFollowLinks        = false;
>> $wgNamespacesWithSubpages[NS_MAIN]      = true;
>> $wgAllowExternalImages                  = true;
>> $wgAllowCopyUploads                     = true;
>> $wgCopyUploadsFromSpecialUpload         = true;
>> $wgFileExtensions               = array_merge($wgFileExtensions, array(
>> 'pdf', 'txt', 'gz', 'bz2', 'deb', 'zip', 'svg', 'diff', 'json' ));
>> $wgVerifyMimeType               = false;
>> $wgDisableUploadScriptChecks    = true;
>> $wgExtraNamespaces = array(
>> $wgNamespacesWithSubpages[NS_FOO]               = true;
>> $wgNamespacesWithSubpages[NS_FOO]       = true;
>> $wgShowExceptionDetails = true;
>> $wgDevelopmentWarnings  = true;
>> $wgSitemapNamespaces            = array( 0, 4, 12 );
>> $wgAllowTitlesInSVG             = true;
>> $wgSVGConverter                 = 'ImageMagick';
>> wfLoadSkin('Vector');
>> wfLoadSkin('MinervaNeue');
>> wfLoadSkin('Timeless');
>>
>> --
>> BOFH excuse #308:
>>
>> CD-ROM server needs recalibration
>> _______________________________________________
>> MediaWiki-l mailing list -- [email protected]
>> To unsubscribe send an email to [email protected]
>> https://lists.wikimedia.org/postorius/lists/mediawiki-l.
>> lists.wikimedia.org/
>>
>
_______________________________________________
MediaWiki-l mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://lists.wikimedia.org/postorius/lists/mediawiki-l.lists.wikimedia.org/

Reply via email to