Gib Website-Bilder aus dem Medienmanager frei, ohne sie zu lizenzieren.
Deploy Test / test (push) Successful in 48s
Deploy Test / deploy (push) Successful in 29s

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
LarsandCursor committed 2026-11-18 22:01:05 +01:00
1 parent 72130d66c5
commit 13530b8171
18 files changed
+940 -2

No files matched your search

+20
View File
@@ -52,6 +52,18 @@ public function forElementUpload(ContentElement $element, string $incoming): voi
$this->rememberElement($element, 'eigen');
}
public function forWebsiteImage(ContentElement $element, string $incoming): void
{
if ($element->output_class !== 'bild' || ! $this->incomingIsSafe($incoming)) {
$this->fail($element, 'Das Bild für die Website wurde nicht übernommen.');
return;
}
$this->still($element, Storage::disk('cms_incoming'), $incoming, 'element-'.$element->id);
$this->rememberElement($element, 'eigen');
}
public function forElementFrame(ContentElement $element, ContentElementVersion $version, float $seconds): void
{
if ($version->content_element_id !== $element->id || $element->output_class !== 'film') {
@@ -201,6 +213,14 @@ private function readableDerived(mixed $path, string $prefix): bool
return Storage::disk('media_derived')->exists($path);
}
private function incomingIsSafe(string $incoming): bool
{
return (str_starts_with($incoming, 'cms/') || str_starts_with($incoming, 'vorschau/'))
&& ! str_contains($incoming, '..')
&& preg_match('#^(cms|vorschau)/[A-Za-z0-9._\-/]+$#', $incoming) === 1
&& Storage::disk('cms_incoming')->exists($incoming);
}
private function secondText(float $seconds): string
{
$seconds = max(0, min(7200, $seconds));