Commit 8246054
committed
fix(envlite): treat fetched salts as literal in Phase 7 render
api.wordpress.org/secret-key/1.1/salt/ returns random bytes that can
contain \`\$\` and \`\\\`. Passing those bytes as preg_replace's
replacement argument means sequences like \`\$1\`, \`\\1\`, or \`\$&\`
get interpreted as backreferences and silently corrupt the salts that
land in src/wp-config.php. Switch to preg_replace_callback so the
salts block is inserted verbatim regardless of what characters it
contains.
Pinned by a regression test that feeds backreference-shaped bytes
through the render path and asserts they survive verbatim.1 parent 2e77230 commit 8246054
2 files changed
Lines changed: 31 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
662 | 662 | | |
663 | 663 | | |
664 | 664 | | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
665 | 669 | | |
666 | 670 | | |
667 | 671 | | |
668 | 672 | | |
669 | 673 | | |
670 | 674 | | |
671 | | - | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
672 | 681 | | |
673 | 682 | | |
674 | 683 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
0 commit comments