Commit 7e4098c
Fix affiliate links corrupted by ampersand-stripping sanitizer (1.52.1)
validateAndSanitizeCSVRow stripped < > " ' & from every string cell,
deleting the & query-param separators in affiliate/image/review URLs.
A TireRack link like ?tireMake=…&tireModel=…&partnum=… collapsed into
one param, so the retailer couldn't resolve the product and bounced the
click to its homepage. Same latent break hit review links (e.g. YouTube
watch?v=…&t=…) and any image URL with a query string.
Exclude the URL/identifier columns (18 link, 19 image, 22 review_link,
28 slug) from the strip, matching the existing 27 (vehicle_breakdown
JSON) exception. Each URL field is still validated by its own strict
allowlist helper (safeLinkURL / safeImageURL / safeReviewLinkURL)
before use, so <>"' can't slip through.
Stored data was never affected — the & were always correct in the DB;
only the rendered link was corrupted, so no data repair is needed.
Verified the full pipeline (row sanitizer -> safeLinkURL) preserves the
URL; build regenerated; 83/83 JS tests pass.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1 parent 767b19f commit 7e4098c
5 files changed
Lines changed: 17 additions & 6 deletions
File tree
- frontend/js
- modules
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
7 | 12 | | |
8 | 13 | | |
9 | 14 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
211 | 211 | | |
212 | 212 | | |
213 | 213 | | |
214 | | - | |
215 | | - | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
216 | 222 | | |
217 | 223 | | |
218 | 224 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
0 commit comments