16 lines
369 B
PHP
16 lines
369 B
PHP
<?php
|
|
|
|
namespace App\Domain\Media;
|
|
|
|
class ThumbnailRef
|
|
{
|
|
public static function url(string $route, string $kind, int $id, mixed $path): ?string
|
|
{
|
|
if (! is_string($path) || ! str_starts_with($path, 'vorschau/') || str_contains($path, '..')) {
|
|
return null;
|
|
}
|
|
|
|
return route($route, ['kind' => $kind, 'subject' => $id]);
|
|
}
|
|
}
|