Page MenuHomePhabricator

TrivialMimeDetection should not be a config setting
Open, Needs TriagePublic

Description

Inspired by T311717#8240595; configuration shouldn't be dynamically adjusted during run time.

TrivialMimeDetection is set to true by thumb.php, in order to pass it onto StreamFile::contentTypeFromPath. That method reads the value through the config registry, which only works because the config for MediaWiki uses GlobalVarConfig. This is brittle and should be replaced by a hook or other mechanism.

This configuration setting is not used outside thumb.php or StreamFile at all: https://codesearch.wmcloud.org/search/?q=TrivialMimeDetection&i=nope&files=&excludeFiles=&repos=.