Manual:$wgDisableUploadScriptChecks

Details
Whether to disable the upload system's checks for HTML/JavaScript.

This is very dangerous on a publicly editable site, so use $wgGroupPermissions to restrict uploading to only those that you trust.