fix(env): skip escaping for valid JSON in environment variables (#6160)

Prevent double-escaping of COMPOSER_AUTH and other JSON environment variables
by detecting valid JSON objects/arrays in realValue() and skipping quote
escaping entirely. This fixes broken JSON values passed to runtime services
while maintaining proper escaping for non-JSON values.

- Add JSON detection before escaping logic in EnvironmentVariable::realValue()
- JSON objects/arrays pass through unmodified, avoiding quote corruption
- Add comprehensive test coverage for JSON vs non-JSON escaping behavior
This commit is contained in:
Andras Bacsai
2026-01-28 10:59:00 +01:00
parent 351b250739
commit c0dadc003d
4 changed files with 133 additions and 20 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long