status : 500; $message = $error instanceof HttpException ? $error->getMessage() : 'خطای داخلی سرور. تنظیمات و دسترسی پوشهٔ ذخیره‌سازی را بررسی کنید.'; header('Cache-Control: no-store'); if ($json) { self::json(['ok' => false, 'error' => $message], $status); return; } http_response_code($status); header('Content-Type: text/plain; charset=utf-8'); echo $message; } public static function postcard(): void { header('Content-Type: image/svg+xml; charset=utf-8'); header('Content-Disposition: attachment; filename="madar-postcard.svg"'); header('X-Content-Type-Options: nosniff'); header("Content-Security-Policy: default-src 'none'; style-src 'unsafe-inline'; sandbox"); view('postcard'); } }