From b14f6d58b472e20b3e6cffd54916ea4fea526acd Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sun, 20 May 2018 11:08:33 +0300 Subject: implement hard limits on downloaded data size for general fetching and cache plugins: MAX_DOWNLOAD_FILE_SIZE & MAX_CACHE_FILE_SIZE --- plugins/cache_starred_images/init.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) mode change 100644 => 100755 plugins/cache_starred_images/init.php (limited to 'plugins/cache_starred_images/init.php') diff --git a/plugins/cache_starred_images/init.php b/plugins/cache_starred_images/init.php old mode 100644 new mode 100755 index 6c32ff57f..8a3464e0d --- a/plugins/cache_starred_images/init.php +++ b/plugins/cache_starred_images/init.php @@ -194,7 +194,7 @@ class Cache_Starred_Images extends Plugin implements IHandler { //_debug("cache_images: downloading: $src to $local_filename"); if (!file_exists($local_filename)) { - $file_content = fetch_file_contents($src); + $file_content = fetch_file_contents(["url" => $src, "max_size" => MAX_CACHE_FILE_SIZE]); if ($file_content && strlen($file_content) > MIN_CACHE_FILE_SIZE) { file_put_contents($local_filename, $file_content); -- cgit v1.2.3-54-g00ecf