# Requires zlib support enabled in PHP.
$wgUseGzip = false;
+# This is the list of preferred extensions for uploading files. Uploading
+# files with extensions not in this list will trigger a warning.
+
+$wgFileExtensions = array( "png", "jpg", "jpeg", "ogg" );
+
+# This is a flag to determine whether or not to check file extensions on
+# upload.
+
+$wgCheckFileExtensions = true;
+
$wgPasswordSalt = true; # For compatibility with old installations set to false
# Which namespaces should support subpages?
global $wpUploadSaveName, $wpUploadTempName, $wpUploadSize;
global $wgSavedFile, $wgUploadOldVersion, $wpUploadOldVersion;
global $wgUseCopyrightUpload , $wpUploadCopyStatus , $wpUploadSource ;
-
+ global $wgCheckFileExtensions, $wgFileExtensions;
+
if ( $wgUseCopyrightUpload )
{
$wpUploadAffirm = 1 ;
( 0 != strcmp( ucfirst( $basename ), $wpUploadSaveName ) ) ) {
return uploadWarning( wfMsg( "badfilename", $wpUploadSaveName ) );
}
- $extensions = array( "png", "jpg", "jpeg", "ogg" );
- if ( ( ! $wpIgnoreWarning ) &&
- ( ! in_array( strtolower( $ext ), $extensions ) ) ) {
+
+ if ( $wgCheckFileExtensions ) {
+ if ( ( ! $wpIgnoreWarning ) &&
+ ( ! in_array( strtolower( $ext ), $wgFileExtensions ) ) ) {
return uploadWarning( wfMsg( "badfiletype", $ext ) );
+ }
}
if ( ( ! $wpIgnoreWarning ) && ( $wpUploadSize > 150000 ) ) {
return uploadWarning( WfMsg( "largefile" ) );