Skip to content

Preserve whitespace in array settings - #1106

Open
missusk wants to merge 1 commit into
Automattic:trunkfrom
missusk:fix/preserve-array-setting-whitespace
Open

Preserve whitespace in array settings#1106
missusk wants to merge 1 commit into
Automattic:trunkfrom
missusk:fix/preserve-array-setting-whitespace

Conversation

@missusk

@missusk missusk commented Aug 28, 2026

Copy link
Copy Markdown

Fixes #1096.

wp_cache_setting() collapsed every whitespace run in an exported array, including whitespace inside its string values. This keeps the setting on one physical line while compacting only var_export()'s layout whitespace, so string values round-trip unchanged.

Testing

  • PHP smoke suite: 89 tests, 118 assertions
  • WordPress integration suite: 53 tests, 148 assertions
  • PHPCS on changed lines
  • Confirmed the previous implementation collapses spaces, tabs and line breaks; this change preserves them byte-for-byte while keeping the config entry on one physical line

Release Notes

  • Fix: preserve whitespace inside array settings written to the cache configuration.

@missusk
missusk marked this pull request as ready for review August 28, 2026 16:26
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.

Array settings are stored with their internal whitespace collapsed

1 participant