Skip to content

Fix double-quoted strings in PHP config parser - #31

Merged
gwillem merged 1 commit into
mainfrom
fix/double-quoted-php-strings
Mar 24, 2026
Merged

Fix double-quoted strings in PHP config parser#31
gwillem merged 1 commit into
mainfrom
fix/double-quoted-php-strings

Conversation

@gwillem

@gwillem gwillem commented Mar 24, 2026

Copy link
Copy Markdown
Contributor

Summary

  • The unquote function in phpcfg only handled single-quoted PHP strings, causing double-quoted values (e.g. "localhost") to retain their surrounding quotes
  • Fixed to strip both single and double quotes, with a length check to prevent panics on empty strings
  • Added test case covering double-quoted Magento 2 env.php format

Test plan

  • Existing tests pass
  • New TestParseDoubleQuotedStrings covers the reported scenario

The unquote function only stripped single quotes, causing double-quoted
values in Magento 2 env.php to retain their surrounding quotes.
@gwillem
gwillem requested a review from a team March 24, 2026 11:22
@gwillem
gwillem merged commit 437b448 into main Mar 24, 2026
3 checks passed
@gwillem
gwillem deleted the fix/double-quoted-php-strings branch March 24, 2026 12:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants