Stop text from being encoded again on every save

Umut: "Beim Startseitenbild wird der Text & umgewandelt, aber in der Ansicht
nach dem Speichern wird & daraus."

RichText::sanitise() treated text without a single tag as plain text and only
escaped it. What the editor sends is HTML, tag or no tag - so "Freudenstadt
& Umgebung" gained one level of encoding on every save (&,
& ...) until the entity stood on the page for everyone to read.
The draft of the kant-it.de home page had already reached three levels.

The same branch carried a second fault of the same kind: nl2br() left the
newline behind the <br>, and the next pass turned it into a second <br> via
breakLines() - one paragraph became two. The branch now decodes first and
replaces the line break instead of adding to it, so it ends up with the same
representation as the DOM branch and both are stable under repeated saves.

scripts/repair-doubled-entities.php cleans up what is already stored: the
published and draft revision of every page and the areas, with a dry run,
each change checked against the validator. Older revisions stay as history.

DEEG: favicon is now its own square mark - the roof gable from the logo,
white on the logo blue, rendered from logo-deeg.png - instead of the centre
crop of the wide logo, which showed the "EE" of the wordmark.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
kantarciandClaude Opus 5 committed 2026-09-16 08:57:20 +02:00
1 parent d885b3ddb5
commit 4539f357c1
6 files changed
+297 -1

No files matched your search

+4
View File
@@ -4,6 +4,10 @@ Selbst betreibbares Block-CMS für PHP-Webhosting mit visuellem Editor nach dem
Die übernommenen Originaldokumente sind `AGENTS.md` und `ENTWICKLUNGSPLAN.md`. Den tatsächlichen Stand enthält `docs/STATUS.md`, Entscheidungen und Datenmodell stehen in `docs/ARCHITECTURE.md`.
## Kaufmännisches Und und Zeilenumbrüche bleiben, wie sie sind (ab 1.20.1)
**Behoben.** Ein Text ohne Auszeichnung wurde beim Speichern doppelt kodiert: aus `&` wurde `&amp;`, beim nächsten Speichern `&amp;amp;` – irgendwann stand die Entity sichtbar auf der Seite. Ebenso wuchsen Zeilenumbrüche: jedes zweite Speichern machte aus einem `<br>` zwei. Beides ist behoben, und wiederholtes Speichern ändert einen Text jetzt nicht mehr. Was bereits falsch gespeichert ist, räumt `php scripts/repair-doubled-entities.php` auf (erst Trockenlauf, dann `--schreiben`).
## Eigenes HTML und eingebettete Seiten (ab 1.20.0)
Der Baustein **Eigenes HTML** (Werkzeugkasten, Gruppe „Seite und Daten“) nimmt Markup auf, das unverändert auf der Seite landet – eigene Tabellen, fremde Widgets, Auszeichnungen, die es als Baustein nicht gibt. Ändern darf ihn nur ein **Administrator**, genau wie das Feld „Eigenes Skript“; für alle anderen ist er sichtbar und schreibgeschützt, und der Server weist eine Änderung ohnehin ab. Zwei Tags nimmt er nicht an: `<script>` gehört unter „Erweitert“ in „Eigenes Skript“, und ein `<iframe>` in den Baustein **Externer Inhalt** – nur der fragt vorher um Einwilligung und trägt den Anbieter in die Sicherheitsrichtlinie ein (ADR 106).