From ae6572858112088e032b522f9688c979d809e8da Mon Sep 17 00:00:00 2001 From: Daniel Winzen Date: Sun, 25 Oct 2020 19:12:47 +0100 Subject: [PATCH] Backwards compatibility to php 7 --- common_config.php | 2 +- cron/update.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/common_config.php b/common_config.php index 17de4b6..e5541b9 100644 --- a/common_config.php +++ b/common_config.php @@ -151,7 +151,7 @@ function is_definitely_ssl() : bool { return false; } -function set_curl_options(CurlHandle $ch){ +function set_curl_options($ch){ curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_USERAGENT, USERAGENT); diff --git a/cron/update.php b/cron/update.php index 97226d3..a3741d2 100644 --- a/cron/update.php +++ b/cron/update.php @@ -32,7 +32,7 @@ add_onions($onions, $db); //delete links that were not seen within a month $db->exec('DELETE FROM ' . PREFIX . "onions WHERE address!='' AND timediff>2419200 AND lasttest-timeadded>2419200;"); -function check_links(array &$onions, CurlHandle &$ch, string $link_to_check, bool $scan_children = false, array &$scanned_onoins = []){ +function check_links(array &$onions, $ch, string $link_to_check, bool $scan_children = false, array &$scanned_onoins = []){ curl_setopt($ch, CURLOPT_URL, $link_to_check); $links=curl_exec($ch); if(preg_match_all('~(https?://)?([a-z0-9]*\.)?([a-z2-7]{16}|[a-z2-7]{56}).onion(/[^\s><"]*)?~i', $links, $addr)){