From fe9971e979d5cddbc5799bc4783ce46b5a7affac Mon Sep 17 00:00:00 2001 From: Daniel Winzen Date: Thu, 15 Oct 2020 19:15:23 +0200 Subject: [PATCH] A few minor optimizations --- cron/tests.php | 2 +- helpers/tmp.php | 2 +- www/admin.php | 2 +- www/onions.php | 6 ++++-- www/test.php | 2 +- 5 files changed, 8 insertions(+), 6 deletions(-) diff --git a/cron/tests.php b/cron/tests.php index de4476b..6a0b483 100644 --- a/cron/tests.php +++ b/cron/tests.php @@ -73,7 +73,7 @@ foreach($curl_handles as $handle){ } $stmt->execute([$onion['id']]); if(!$stmt->fetch(PDO::FETCH_NUM)){ - if(preg_match('~^HTTP/1\.(1|0) 504 Connect to ([a-z2-7]{16}|[a-z2-7]{56})\.onion(:80)? failed: SOCKS error: host unreachable~', $content, $match)){ + if(preg_match('~^HTTP/1\.[10] 504 Connect to ([a-z2-7]{16}|[a-z2-7]{56})\.onion(:80)? failed: SOCKS error: host unreachable~', $content, $match)){ $phishing_stmt->execute([$onion['id'], $match[2]]); }elseif(strpos($content, "HttpReadDisconnect('Server disconnected',)")!==false){ $phishing_stmt->execute([$onion['id'], '']); diff --git a/helpers/tmp.php b/helpers/tmp.php index 4465ca8..5ad46ba 100644 --- a/helpers/tmp.php +++ b/helpers/tmp.php @@ -43,7 +43,7 @@ elseif(preg_match('~^HTTP/1\.1\s500\sInternal\sServer\sError\r\n~', $header) && $move->execute($tmp); echo " - SCAM - moved"; } -elseif(preg_match('~^HTTP/1\.1\s500\sInternal\sServer\sError\r\n~', $header) && $body==='' && preg_match('~Connection:\s\[object\sObject\]\r\n~', $header2)){ +elseif(preg_match('~^HTTP/1\.1\s500\sInternal\sServer\sError\r\n~', $header) && $body==='' && preg_match('~Connection:\s\[object\sObject]\r\n~', $header2)){ $move->execute($tmp); echo " - SCAM - moved"; } diff --git a/www/admin.php b/www/admin.php index 37d98d1..7ac4254 100644 --- a/www/admin.php +++ b/www/admin.php @@ -14,7 +14,7 @@ echo ''; echo "$I[admintitle]"; echo ''; echo ''; -echo ''; +echo ''; echo ''; echo "

$I[admintitle]

"; print_langs(); diff --git a/www/onions.php b/www/onions.php index 1c8dcf7..3f89553 100644 --- a/www/onions.php +++ b/www/onions.php @@ -18,6 +18,8 @@ * along with this program. If not, see . */ +use JetBrains\PhpStorm\ExitPoint; + if($_SERVER['REQUEST_METHOD']==='HEAD'){ exit; // ignore headers, no further processing needed } @@ -63,7 +65,7 @@ function send_html(){ echo ''; echo ''; echo ''; - echo ''; + echo ''; echo ''; echo ''; echo "

$I[title]

"; @@ -445,7 +447,7 @@ function get_pagination($category, $pages){ } function send_captcha(){ - global $I, $db, $memcached; + global $db; $difficulty=1; if($difficulty===0 || !extension_loaded('gd')){ return; diff --git a/www/test.php b/www/test.php index 1aa6112..177510d 100644 --- a/www/test.php +++ b/www/test.php @@ -10,7 +10,7 @@ echo "$I[testtitle]"; echo ''; echo ''; echo ''; -echo ''; +echo ''; echo ''; echo '

Online-Test

'; print_langs();