Commit 55815cb
fix(sync): quoted-string-aware header tokenizer + bump 0.2.24-woo-2 — WOO-552
Address Barry's review comment on the WOO-553 dev-branch PR
(#1840 line 9111) by porting the same fix to the WOO stable
hotfix line:
`explode(';', $header)` also splits semicolons that live inside a
quoted filename. `attachment; filename="rapport; versie 2.pdf"`
corrupts to `rapport` instead of `rapport; versie 2.pdf`. The fix
is a small quoted-string-aware tokenizer `splitHeaderParameters()`
that tracks a `"`-open state and only splits `;` outside quotes,
per RFC 6266 §4 grammar.
Changes:
- New private helper `splitHeaderParameters(string): array` on
`SynchronizationService`.
- `parseContentDispositionFilename()` now delegates the `;`-split
to that helper instead of `explode(';', ...)` — behaviour on
well-formed xxllnc headers is unchanged; corrupt scenarios that
the naive split would drop are now preserved verbatim.
- Rename local `$eq` → `$eqPos` in the parser (matches the
post-review dev-branch style, avoids the phpmd ShortVariable
rule if the hotfix line ever gets those checks).
- 4 new unit tests locking behaviour:
* `testFilenameWithSemicolonInsideQuotedValuePreservesFilename`
— the general quoted-`;` case.
* `testFilenameWithSemicolonAndSpaceInsideQuotedValuePreservesFilename`
— Barry's exact example from PR #1840 (rapport; versie 2.pdf).
* `testFilenameWithPathTraversalPayloadIsReturnedVerbatim` —
contract: sanitization is downstream's responsibility.
* `testFilenameWithWhitespaceAroundEqualsIsAccepted` — locks
`filename = "…"` handling.
Total: 14 tests (was 10), all green locally.
`appinfo/info.xml` version bumped `0.2.24-woo-1` → `0.2.24-woo-2`
so the next push cuts a fresh prerelease `v0.2.24-woo-2` that
supersedes the currently-installed `v0.2.24-woo-1` on
openwoo.commonground.nu. Deploy via `app_versions` app pin (same
mechanic Wilco used on r17).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent f4208e4 commit 55815cb
3 files changed
Lines changed: 94 additions & 11 deletions
File tree
- appinfo
- lib/Service
- tests/Unit/Service
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3086 | 3086 | | |
3087 | 3087 | | |
3088 | 3088 | | |
3089 | | - | |
3090 | | - | |
3091 | | - | |
3092 | | - | |
3093 | | - | |
3094 | | - | |
| 3089 | + | |
| 3090 | + | |
| 3091 | + | |
| 3092 | + | |
| 3093 | + | |
| 3094 | + | |
| 3095 | + | |
| 3096 | + | |
| 3097 | + | |
3095 | 3098 | | |
3096 | 3099 | | |
3097 | 3100 | | |
| |||
3100 | 3103 | | |
3101 | 3104 | | |
3102 | 3105 | | |
3103 | | - | |
3104 | | - | |
| 3106 | + | |
| 3107 | + | |
3105 | 3108 | | |
3106 | 3109 | | |
3107 | | - | |
3108 | | - | |
| 3110 | + | |
| 3111 | + | |
3109 | 3112 | | |
3110 | 3113 | | |
3111 | 3114 | | |
| |||
3120 | 3123 | | |
3121 | 3124 | | |
3122 | 3125 | | |
| 3126 | + | |
| 3127 | + | |
| 3128 | + | |
| 3129 | + | |
| 3130 | + | |
| 3131 | + | |
| 3132 | + | |
| 3133 | + | |
| 3134 | + | |
| 3135 | + | |
| 3136 | + | |
| 3137 | + | |
| 3138 | + | |
| 3139 | + | |
| 3140 | + | |
| 3141 | + | |
| 3142 | + | |
| 3143 | + | |
| 3144 | + | |
| 3145 | + | |
| 3146 | + | |
| 3147 | + | |
| 3148 | + | |
| 3149 | + | |
| 3150 | + | |
| 3151 | + | |
| 3152 | + | |
| 3153 | + | |
| 3154 | + | |
| 3155 | + | |
| 3156 | + | |
| 3157 | + | |
| 3158 | + | |
| 3159 | + | |
| 3160 | + | |
| 3161 | + | |
| 3162 | + | |
| 3163 | + | |
| 3164 | + | |
| 3165 | + | |
| 3166 | + | |
3123 | 3167 | | |
3124 | 3168 | | |
3125 | 3169 | | |
| |||
Lines changed: 39 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
132 | 171 | | |
0 commit comments