request->documentType); // Erst prüfen, dann schreiben -- sonst bliebe bei einem Fehler ein halb gespeicherter Stand übrig. $rejection = $this->rejectBareAssetInStyle(); if ($rejection !== null) { $response->message = $rejection; return $response; } foreach ($this->request->blocks as $block => $content) { $template = $existing->get($block); if ($template === null || !$template->editable) { $response->skipped[] = $block; continue; } $template->update(['content' => (string) $content]); } $response->success = true; $response->message = $response->skipped === [] ? 'Die Vorlage wurde gespeichert.' : 'Die Vorlage wurde gespeichert; nicht editierbare Blöcke blieben unverändert.'; return $response; } /** * Ein Bild-Platzhalter, der im CSS nicht in `url(...)` steht, expandiert zu einem Data-URI, das * dompdf nicht auslagern kann -- der Parser läuft dann minutenlang und der FPM-Worker stirbt am * Zeitlimit (502). Solches CSS wird gar nicht erst gespeichert. * * @return string|null Fehlermeldung, oder null wenn nichts zu beanstanden ist. */ private function rejectBareAssetInStyle(): ?string { $style = $this->request->blocks[DocumentTemplate::BLOCK_STYLE] ?? null; if ($style === null || preg_match('/(?