Page MenuHomePhabricator

Editing the DefaultSettings.php causes the file to get corrupt
Closed, InvalidPublic

Description

Author: sadaou

Description:
I have edited the file DefaultSettings.php for configure the File-Upload regarding to the
documentation on http://meta.wikimedia.org/wiki/Hilfe:Konfigurieren#Datei-Upload
If i now change $wgFileExtensions = array( 'png', 'gif', 'jpg', 'jpeg', 'ogg' );
and add a filetype such as 'doc' and then reenter mediawiki, i get several exceptions in
the browser like:

Warning: Cannot modify header information - headers already sent by (output started at
C:\Programme\xampp\htdocs\mediawiki-1.7.1\includes\DefaultSettings.php:1) in
C:\Programme\xampp\htdocs\mediawiki-1.7.1\includes\OutputPage.php on line 508

If i now revoke the changes, the errors still are displayed. The only way to fix this
problem is to restore a backup file. How can i configure upload for accepting additional
filetypes?


Version: 1.7.x
Severity: major
OS: Windows XP
Platform: PC

Details

Reference
bz6902

Event Timeline

bzimport raised the priority of this task from to High.Nov 21 2014, 9:21 PM
bzimport set Reference to bz6902.
bzimport added a subscriber: Unknown Object (MLST).

You should never edit DefaultSettings.php. Every changes you want to make to
settings from DefaultSettings.php should be made in LocalSettings.php (that
overrides the defaults). Copy back the backup and edit LocalSettings.php

sadaou wrote:

What value should be changed in LocalSettings.php to add the additional filetypes?

Well, since there is no corresponding value in LocalSettings.php, you should
copy/paste the code you want from DefaultSettings.php.

I would put near the end (not at the end) of the file the following:
$wgFileExtensions = array( 'png', 'gif', 'jpg', 'jpeg', 'ogg', 'doc' );

sadaou wrote:

Ok, that works... Thank you for helping me!!

  • Bug 15822 has been marked as a duplicate of this bug. ***
Gilles raised the priority of this task from High to Unbreak Now!.Dec 4 2014, 10:21 AM
Gilles moved this task from Untriaged to Done on the Multimedia board.
Gilles lowered the priority of this task from Unbreak Now! to High.Dec 4 2014, 11:21 AM