$found['expires_at']) { http_response_code(403); echo 'Link expired'; exit; } // 一次性链接已使用则拒绝访问 if (!empty($found['single_use']) && !empty($found['used'])) { http_response_code(403); echo 'Link already used'; exit; } $id = $found['id'] ?? ''; if (!$id || !safeId($id)) { http_response_code(400); echo 'Bad id'; exit; } $file = $docsDir . DIRECTORY_SEPARATOR . $id . '.html'; if (!file_exists($file)) { http_response_code(404); echo 'Not found'; exit; } $content = file_get_contents($file); $index = readJson($indexFile); $title = $id; foreach ($index as $it) { if (($it['id'] ?? '') === $id) { $title = $it['title'] ?? $id; break; } } ?>