A few minor optimizations

This commit is contained in:
Daniel Winzen
2020-10-15 19:15:23 +02:00
parent 9652d30c51
commit fe9971e979
5 changed files with 8 additions and 6 deletions

View File

@ -73,7 +73,7 @@ foreach($curl_handles as $handle){
} }
$stmt->execute([$onion['id']]); $stmt->execute([$onion['id']]);
if(!$stmt->fetch(PDO::FETCH_NUM)){ 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]]); $phishing_stmt->execute([$onion['id'], $match[2]]);
}elseif(strpos($content, "<body>HttpReadDisconnect('Server disconnected',)</body>")!==false){ }elseif(strpos($content, "<body>HttpReadDisconnect('Server disconnected',)</body>")!==false){
$phishing_stmt->execute([$onion['id'], '']); $phishing_stmt->execute([$onion['id'], '']);

View File

@ -43,7 +43,7 @@ elseif(preg_match('~^HTTP/1\.1\s500\sInternal\sServer\sError\r\n~', $header) &&
$move->execute($tmp); $move->execute($tmp);
echo " - SCAM - moved"; 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); $move->execute($tmp);
echo " - SCAM - moved"; echo " - SCAM - moved";
} }

View File

@ -14,7 +14,7 @@ echo '<!DOCTYPE html><html><head>';
echo "<title>$I[admintitle]</title>"; echo "<title>$I[admintitle]</title>";
echo '<meta http-equiv="Content-Type" content="text/html; charset=utf-8">'; echo '<meta http-equiv="Content-Type" content="text/html; charset=utf-8">';
echo '<meta name=viewport content="width=device-width, initial-scale=1">'; echo '<meta name=viewport content="width=device-width, initial-scale=1">';
echo '<style type="text/css">.red{color:red;} .green{color:green;}</style>'; echo '<style type="text/css">.red{color:red} .green{color:green}</style>';
echo '</head><body>'; echo '</head><body>';
echo "<h1>$I[admintitle]</h1>"; echo "<h1>$I[admintitle]</h1>";
print_langs(); print_langs();

View File

@ -18,6 +18,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
use JetBrains\PhpStorm\ExitPoint;
if($_SERVER['REQUEST_METHOD']==='HEAD'){ if($_SERVER['REQUEST_METHOD']==='HEAD'){
exit; // ignore headers, no further processing needed exit; // ignore headers, no further processing needed
} }
@ -63,7 +65,7 @@ function send_html(){
echo '<meta http-equiv="Content-Type" content="text/html; charset=utf-8">'; echo '<meta http-equiv="Content-Type" content="text/html; charset=utf-8">';
echo '<meta name="author" content="Daniel Winzen">'; echo '<meta name="author" content="Daniel Winzen">';
echo '<meta name="viewport" content="width=device-width, initial-scale=1">'; echo '<meta name="viewport" content="width=device-width, initial-scale=1">';
echo '<style type="text/css">.red{color:red;} .green{color:green;} .up td+td+td{background-color:#aaff88;} .down td+td+td{background-color:#ff4444;} .promo{outline:medium solid #FFD700;} .list{display: inline-block; padding: 0px; margin: 0px;} .list li{display:inline;} .active{font-weight:bold;} .down td+td+td+td+td,.up td+td+td+td+td{background-color:unset;} #maintable td{word-break:break-all;} #maintable td+td+td{word-break:unset;} #maintable tr td:first-child{min-width:16em}</style>'; echo '<style type="text/css">.red{color:red} .green{color:green} .up td+td+td{background-color:#aaff88} .down td+td+td{background-color:#ff4444} .promo{outline:medium solid #FFD700} .list{display: inline-block; padding: 0; margin: 0} .list li{display:inline} .active{font-weight:bold} .down td+td+td+td+td,.up td+td+td+td+td{background-color:unset} #maintable td{word-break:break-all} #maintable td+td+td{word-break:unset} #maintable tr td:first-child{min-width:16em}</style>';
echo '<base rel="noopener" target="_blank">'; echo '<base rel="noopener" target="_blank">';
echo '</head><body>'; echo '</head><body>';
echo "<h1>$I[title]</h1>"; echo "<h1>$I[title]</h1>";
@ -445,7 +447,7 @@ function get_pagination($category, $pages){
} }
function send_captcha(){ function send_captcha(){
global $I, $db, $memcached; global $db;
$difficulty=1; $difficulty=1;
if($difficulty===0 || !extension_loaded('gd')){ if($difficulty===0 || !extension_loaded('gd')){
return; return;

View File

@ -10,7 +10,7 @@ echo "<title>$I[testtitle]</title>";
echo '<meta http-equiv="Content-Type" content="text/html; charset=utf-8">'; echo '<meta http-equiv="Content-Type" content="text/html; charset=utf-8">';
echo '<meta name="author" content="Daniel Winzen">'; echo '<meta name="author" content="Daniel Winzen">';
echo '<meta name="viewport" content="width=device-width, initial-scale=1">'; echo '<meta name="viewport" content="width=device-width, initial-scale=1">';
echo '<style type="text/css">.red{color:red;} .green{color:green;}</style>'; echo '<style type="text/css">.red{color:red} .green{color:green}</style>';
echo '</head><body>'; echo '</head><body>';
echo '<h1>Online-Test</h1>'; echo '<h1>Online-Test</h1>';
print_langs(); print_langs();