Upload via GUI (267 Dateien)
This commit is contained in:
@@ -99,6 +99,11 @@ $out = sanitize_staff_html($ok);
|
||||
foreach (['<p>', '<b>Welt</b>', '<i>kursiv</i>', 'href="https://example.org/a?x=1&y=2"', '<li>Zwei</li>', 'colspan="2"', 'style="color: red"', '<blockquote>Zitat</blockquote>', '<br>'] as $needle) {
|
||||
$check(str_contains($out, $needle), "Erlaubtes HTML ging verloren ({$needle}): {$out}");
|
||||
}
|
||||
// Skalierte Bilder (Signatur): Breite als Attribut und Stil bleiben erhalten, riskante Stile nicht
|
||||
$out = sanitize_staff_html('<img src="https://example.org/uploads/logo.png" alt="" width="130" style="max-width:100%;width:130px;height:auto">');
|
||||
$check(str_contains($out, 'src="https://example.org/uploads/logo.png"') && str_contains($out, 'width="130"') && str_contains($out, 'width: 130px') && str_contains($out, 'height: auto'), 'skaliertes Bild behält Adresse, Breite und Stil: ' . $out);
|
||||
$out = sanitize_staff_html('<img src="https://example.org/a.png" width="130" style="width:130px;position:fixed;background:url(https://evil.example/x.gif)">');
|
||||
$check(str_contains($out, 'width: 130px') && !str_contains($out, 'position') && !str_contains($out, 'evil'), 'beim skalierten Bild werden riskante Stile trotzdem entfernt: ' . $out);
|
||||
$check(sanitize_staff_html(' ') === '', 'Leerer Text');
|
||||
$check(sanitize_staff_html('Preis < 5 und > 3') === 'Preis < 5 und > 3', 'Kleiner/Größer im Fließtext: ' . sanitize_staff_html('Preis < 5 und > 3'));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user