Skip to content

Support list configuration values via JSON arrays (5.x backport of #27) - #32

Merged
snake14 merged 1 commit into
5.x-devfrom
5.x-json-array-env-values
Oct 19, 2026
Merged

snake14 merged 1 commit into
5.x-devfrom
5.x-json-array-env-values

Conversation

@snake14

@snake14 snake14 commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Description

Backport of #27 and #29 to 5.x: environment variables holding a JSON array are now used as list values, so settings such as trusted_hosts can be set from the environment. JSON objects are decoded into keyed arrays; any other value is used literally, as before.

The decode uses plain json_decode() rather than JSON_THROW_ON_ERROR/JsonException, which 5.x's PHP 7.2 floor doesn't have; the behaviour is the same.

Issue No

Fixes #9 on 5.x (backport of #27 and #29)

Steps to Replicate the Issue

  1. Set e.g. MATOMO_GENERAL_TRUSTED_HOSTS=["192.168.1.1","192.168.2.1"]
  2. Expected: the configured trusted hosts are respected
  3. Actual: they are ignored, since the value is a string rather than an array

Checklist

  • [✔] Tested locally or on demo2/demo3?
  • [NA] New test case added/updated?
  • [NA] Are all newly added texts included via translation?
  • [NA] Are text sanitized properly? (Eg use of v-text v/s v-html for vue)
  • [✔] Version bumped?
  • [✔] I have understood, reviewed, and tested all AI outputs before use
  • [✔] All AI instructions respect security, IP, and privacy rules
  • [✔] Documentation updated?

…#29)

Configuration options which expect a list of values are now supported by
JSON arrays in environment variables. Values that are not a JSON array or
object are used literally, as before. The decode avoids JsonException for
PHP 7.2.
@snake14
snake14 requested a review from a team October 16, 2026 04:38
@inflatador

Copy link
Copy Markdown

@snake14 @mbrodala On behalf of the Wikimedia Foundation, thank you very much for the quick turnaround!

@snake14
snake14 enabled auto-merge (squash) October 18, 2026 20:11
@snake14
snake14 merged commit 77c7c5f into 5.x-dev Oct 19, 2026
2 of 3 checks passed
@AltamashShaikh
AltamashShaikh deleted the 5.x-json-array-env-values branch October 19, 2026 06:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants