Speichern von Bildern als data-URL statt Datei behoben

This commit is contained in:
Matthias Grief
2025-01-07 10:57:32 +01:00
parent e8315d1019
commit c66ff41878

View File

@@ -154,9 +154,8 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST') {
$formulas[] = new Task($text, $answers);
}
$article = htmlentities($_POST['article'], ENT_HTML401, 'UTF-8');
$article = mb_convert_encoding($_POST['article'], 'HTML-ENTITIES', 'UTF-8');
$dom = new DOMDocument();
$dom->encoding = 'UTF-8';
$dom->loadHTML($article, LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD);
$htmlImages = $dom->getElementsByTagName('img');
$newImages = array();