Commit 7d2be52
committed
bug symfony#61453 [VarExporter] Fix serializing classes with __serialize() returning unprefixed private properties (nicolas-grekas)
This PR was merged into the 6.4 branch.
Discussion
----------
[VarExporter] Fix serializing classes with __serialize() returning unprefixed private properties
| Q | A
| ------------- | ---
| Branch? | 6.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Issues | -
| License | MIT
When `__serialize()` returns `['foo' => 123]`, the native implicit `__unserialize()` function will happily propagate this `foo` value to the first `private $foo` property in the inheritance chain.
This didn't work when using VarExporter, and this PR fixes it.
Commits
-------
3410a72 [VarExporter] Fix serializing classes with __serialize() returning unprefixed private propertiesFile tree
3 files changed
+49
-33
lines changed- src/Symfony/Component/VarExporter
- Internal
- Tests
- Fixtures
3 files changed
+49
-33
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
| 79 | + | |
| 80 | + | |
79 | 81 | | |
80 | 82 | | |
81 | 83 | | |
82 | 84 | | |
83 | 85 | | |
84 | 86 | | |
85 | | - | |
| 87 | + | |
86 | 88 | | |
87 | 89 | | |
88 | 90 | | |
89 | 91 | | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
| 92 | + | |
| 93 | + | |
97 | 94 | | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
| 95 | + | |
106 | 96 | | |
107 | 97 | | |
108 | 98 | | |
| |||
118 | 108 | | |
119 | 109 | | |
120 | 110 | | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
| 111 | + | |
125 | 112 | | |
126 | 113 | | |
127 | 114 | | |
| |||
145 | 132 | | |
146 | 133 | | |
147 | 134 | | |
148 | | - | |
149 | | - | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
150 | 141 | | |
151 | 142 | | |
152 | 143 | | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | 144 | | |
159 | 145 | | |
160 | 146 | | |
| |||
167 | 153 | | |
168 | 154 | | |
169 | 155 | | |
170 | | - | |
| 156 | + | |
171 | 157 | | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
172 | 164 | | |
173 | 165 | | |
174 | 166 | | |
| |||
Lines changed: 11 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
11 | 16 | | |
12 | 17 | | |
13 | 18 | | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
14 | 24 | | |
15 | 25 | | |
16 | 26 | | |
| |||
Lines changed: 18 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
468 | 468 | | |
469 | 469 | | |
470 | 470 | | |
471 | | - | |
| 471 | + | |
472 | 472 | | |
473 | | - | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
474 | 485 | | |
475 | 486 | | |
476 | 487 | | |
477 | | - | |
| 488 | + | |
| 489 | + | |
478 | 490 | | |
479 | 491 | | |
480 | 492 | | |
481 | 493 | | |
482 | 494 | | |
483 | | - | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
484 | 498 | | |
485 | 499 | | |
486 | 500 | | |
0 commit comments