Lauftext auf der Startseite reparieren

Der Lauftext stand in Short-Open-Tags:

    +++<? echo $Laufband1 ?>+++

short_open_tag ist auf dem Server abgeschaltet, deshalb landete der
PHP-Quelltext woertlich im ausgelieferten HTML. Der Browser hat
"<? echo $Laufband1 ?>" als unbekanntes Tag verworfen - sichtbar
blieben nur die Pluszeichen. Ueberprueft am ausgelieferten HTML der
Startseite, dort stand der Quelltext unveraendert drin.

Beide Vorkommen nutzen jetzt <?php und eine gemeinsam aufbereitete
Ausgabe:

- Leere Eintraege werden uebersprungen; sind alle sechs leer, entfaellt
  das Laufband ganz, statt leere +++ durchs Bild zu schicken.
- Der Inhalt kommt aus dem Editor in webseitenadmin.php und ist in der
  Datenbank HTML. config.inc.php entfernt zwar die Tags, die Entities
  bleiben aber stehen - daher erst html_entity_decode(), dann
  htmlspecialchars(). Sonst waere aus &amp; ein sichtbares "&amp;" und
  aus &Ouml; ein "&Ouml;" geworden.
- Beide Bloecke trugen dieselben id-Attribute (marquee-cont, scroll).
  Doppelte ids sind ungueltiges HTML; sie sind durch eine Klasse
  ersetzt, css/ticker.css spricht jetzt beide Schreibweisen an.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-09-03 00:00:58 +02:00
co-authored by Claude Opus 5
parent 864218c1b8
commit 8e3da39a40
2 changed files with 35 additions and 8 deletions
+4 -2
View File
@@ -1,8 +1,10 @@
#marquee-cont { /* Der Lauftext kommt auf der Startseite zweimal vor - deshalb Klasse
statt id, doppelte id-Attribute waeren ungueltiges HTML. */
.marquee-cont, #marquee-cont {
background: #ff6363; background: #ff6363;
margin-top:10px; margin-top:10px;
} }
#marquee-cont marquee { .marquee-cont marquee, #marquee-cont marquee {
margin-top: 5px; margin-top: 5px;
background: #ff6363; background: #ff6363;
} }
+31 -6
View File
@@ -120,11 +120,34 @@
?> ?>
<hr> <hr>
<div id="marquee-cont"> <?php
<marquee onmouseover="this.stop();" onmouseout="this.start();" id='scroll'> // Der Lauftext stand hier in Short-Open-Tags (<? ... ?>). Die sind auf dem
+++<? echo $Laufband1 ?>+++ &nbsp;&nbsp; +++<? echo $Laufband2 ?>+++ &nbsp;&nbsp; +++<? echo $Laufband3 ?>+++ &nbsp;&nbsp; +++<? echo $Laufband4 ?>+++ &nbsp;&nbsp; +++<? echo $Laufband5 ?>+++ &nbsp;&nbsp; +++<? echo $Laufband6 ?>+++ // Server abgeschaltet, weshalb der PHP-Quelltext woertlich im HTML landete
// und der Browser ihn als unbekanntes Tag verworfen hat - sichtbar blieben
// nur die +++.
// Leere Eintraege werden uebersprungen, sonst scrollen leere +++ durchs Bild.
$laufbandEintraege = array_filter(
[$Laufband1, $Laufband2, $Laufband3, $Laufband4, $Laufband5, $Laufband6],
static function ($eintrag) { return trim((string)$eintrag) !== ''; }
);
$laufbandAusgabe = '';
foreach ($laufbandEintraege as $eintrag) {
// Der Inhalt kommt aus dem Editor in webseitenadmin.php und ist in der
// Datenbank HTML. config.inc.php entfernt die Tags, die Entities bleiben
// aber stehen - erst dekodieren, dann escapen, sonst wird aus &amp; ein
// sichtbares "&amp;".
$klartext = html_entity_decode((string)$eintrag, ENT_QUOTES | ENT_HTML5, 'UTF-8');
$laufbandAusgabe .= '+++' . htmlspecialchars(trim($klartext), ENT_QUOTES, 'UTF-8')
. '+++ &nbsp;&nbsp; ';
}
?>
<?php if ($laufbandAusgabe !== ''): ?>
<div class="marquee-cont">
<marquee onmouseover="this.stop();" onmouseout="this.start();">
<?php echo $laufbandAusgabe; ?>
</marquee> </marquee>
</div> </div>
<?php endif; ?>
<hr> <hr>
<br> <br>
@@ -142,11 +165,13 @@
<!-- laufband --> <!-- laufband -->
<div id="marquee-cont"> <?php if ($laufbandAusgabe !== ''): ?>
<marquee onmouseover="this.stop();" onmouseout="this.start();" id='scroll'> <div class="marquee-cont">
+++<? echo $Laufband1 ?>+++ &nbsp;&nbsp; +++<? echo $Laufband2 ?>+++ &nbsp;&nbsp; +++<? echo $Laufband3 ?>+++ &nbsp;&nbsp; +++<? echo $Laufband4 ?>+++ &nbsp;&nbsp; +++<? echo $Laufband5 ?>+++ &nbsp;&nbsp; +++<? echo $Laufband6 ?>+++ <marquee onmouseover="this.stop();" onmouseout="this.start();">
<?php echo $laufbandAusgabe; ?>
</marquee> </marquee>
</div> </div>
<?php endif; ?>