From e9b6f113d96d6ec375d8a2d75bfd91cc1996c8ea Mon Sep 17 00:00:00 2001 From: xfnw Date: Fri, 22 Oct 2021 11:43:33 -0400 Subject: [PATCH] limit filesize of crawls --- crawl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crawl.php b/crawl.php index d19e0a4..1ec7193 100644 --- a/crawl.php +++ b/crawl.php @@ -42,7 +42,7 @@ foreach ($arg as $url) { $stmt = $db->prepare('DELETE FROM indexed WHERE url = ?'); $stmt->execute([htmlspecialchars(htmlspecialchars_decode($url))]); - $file = file_get_contents($url, false, $context); + $file = file_get_contents($url, false, $context, 0, 1000000); if (!$file || strpos($http_response_header[0],'200 OK') === false) continue; $title = page_title($file);