Fix custom CSS injection on auth frontend pages#265
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (7)
📝 WalkthroughWalkthroughIl CSS personalizzato viene gestito da una partial condivisa, che legge e normalizza la configurazione prima del rendering condizionale. La partial è inclusa nelle pagine di autenticazione e nel layout frontend. ChangesCSS personalizzato condiviso
Estimated code review effort: 2 (Simple) | ~10 minuti Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
I've reimplemented this in #273 and am closing this PR in its favour — the feature itself (custom CSS reaching the auth pages) is a good call and #273 keeps it, with credit to you. The reason I didn't merge this branch directly: it emits the CSS through #273 uses If you want to hide the #255 registration fields, once #273 ships your CSS in Settings → Advanced → Custom CSS will apply on |
…ontributor help (#237) Custom CSS on auth pages (fixes #262, closes #265) -------------------------------------------------- The admin-configured advanced.custom_header_css only applied to the app chrome, so it never reached the login/register/forgot/reset pages — a user who wanted to hide the #255 registration fields via CSS couldn't. Extract a shared partial app/Views/auth/partials/custom-css.php, include it on all five auth views, and refactor frontend/layout.php to use it (removing its inline duplicate). Reimplements the intent of PR #265 by @Himura2la SAFELY: that PR emitted the CSS through ContentSanitizer::normalizeExternalAssets() (fonts-only), which does NOT strip a </style><script>… breakout — merging it would have reintroduced the stored-XSS fixed earlier, now on UNAUTHENTICATED pages. The partial uses ContentSanitizer::sanitizeCustomCss() (the same render-time sanitizer as frontend/layout.php), which strips <style>/<script> and HTML comment markers. Verified live: an injected </style><script> payload renders as inert CSS text (window flag undefined, title unchanged, 0 script tags) while legitimate CSS still applies. Role-specific contributor help text (#237, @HansUwe52) ------------------------------------------------------ Illustrator/Translator/Curator/Colorist fields showed the same generic "search for an existing author" hint. Give each its own role-named help string, translated across all four locales (it/en/de/fr). Guard: tests/auth-custom-css-and-contributor-help.unit.php asserts the partial uses the safe sanitizer, every view includes it, and all four locales carry the role-help keys.
Fixes #262
Summary by CodeRabbit