fix(file/types): Preserve keys (including numeric-looking ones)

Replace array_merge with array_replace for definitions

Signed-off-by: Josh <josh.t.richards@gmail.com>
pull/56919/head
Josh 2025-12-08 11:56:05 +07:00
parent 50a94a35ee
commit e476a22a50
1 changed files with 1 additions and 1 deletions

@ -97,7 +97,7 @@ class Detection implements IMimeTypeDetector {
if (file_exists($this->customConfigDir . '/' . $fileName)) {
$custom = json_decode(file_get_contents($this->customConfigDir . '/' . $fileName), true);
if (json_last_error() === JSON_ERROR_NONE) {
$definitions = array_merge($definitions, $custom);
$definitions = array_replace($definitions, $custom);
} else {
$this->logger->warning('Failed to parse ' . $fileName . ': ' . json_last_error_msg());
}