$seed, 'size' => '256']; foreach ($allowedParams as $param) { $value = Lorelei::normalizeVariant((string)($_GET[$param] ?? '')); if ($value !== '') { $query[$param] = $value; } } $cacheKey = sha1(json_encode($query, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE) ?: $seed); $cacheFile = $cacheDir . '/' . $cacheKey . '.svg'; $svg = is_file($cacheFile) ? file_get_contents($cacheFile) : false; if ($svg === false) { $url = 'https://api.dicebear.com/10.x/lorelei/svg?' . http_build_query($query); $context = stream_context_create([ 'http' => [ 'method' => 'GET', 'timeout' => 6, 'header' => "User-Agent: Papa-Kind-Treff/1.0\r\nAccept: image/svg+xml\r\n", ], ]); $remote = @file_get_contents($url, false, $context); if (is_string($remote) && str_contains($remote, '