Fehler: CSP und eure Erweiterung

Karsten Koch's Avatar

Karsten Koch

06 Feb, 2026 10:21 AM

Produkt: Antispam Contao

Moin,
bin hier gerade auf ein Problem beim Aktivieren von CSP im Startpunkt der Website und dem Einsatz eurer Erweiterung 'AntiSpam' gestoßen.
Dort wird ein Fehler erzeugt, bzw. die Scripte blockiert. Habe das jetzt hier gelöst und wollte euch meinen Weg nur mal durchgeben, eventuell könnt ihr kja beim nächsten Update das korrigieren.
- In dem Template 'form_rocksolid_antispam.html5' habe ich das Inline-CSS entfernt und über eine Klasse das Element ausgeblendet. - In 'vendor/madeyourday/contao-rocksolid-antispam/src/Form/AntispamField.php' habe ich in Zeile 161 laut Contao-Dokumentation folgendes beim Script-Tag eingefügt: '$this->attr()->setIfExists('nonce', $this->nonce('script-src'))' Nun funktioniert es auch bei aktiviertem CSP
Hoffe das ist hilfreich.
Gruß
Karsten

  1. Support Staff 1 Posted by RockSolid Theme... on 06 Feb, 2026 03:25 PM

    RockSolid Themes's Avatar

    Vielen Dank für Ihre Nachricht.

    Wir werden den CSP-Support im nächsten Update der Erweiterung prüfen und entsprechend implementieren.

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac