Bugfix and minor improvements

This commit is contained in:
Daniel Winzen
2016-09-28 20:51:43 +02:00
parent 08f666941e
commit 2e8f51080c
4 changed files with 12 additions and 7 deletions

View File

@ -19,6 +19,9 @@
*/ */
header('Content-Type: text/html; charset=UTF-8'); header('Content-Type: text/html; charset=UTF-8');
header('Pragma: no-cache');
header('Cache-Control: no-cache, no-store, must-revalidate, max-age=0');
header('Expires: 0');
if($_SERVER['REQUEST_METHOD']==='HEAD'){ if($_SERVER['REQUEST_METHOD']==='HEAD'){
exit; // headers sent, no further processing needed exit; // headers sent, no further processing needed
} }
@ -32,6 +35,7 @@ asort($categories);
echo '<!DOCTYPE html><html><head>'; 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 '<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 "<h2>$I[admintitle]</h2>"; echo "<h2>$I[admintitle]</h2>";

View File

@ -61,6 +61,7 @@ function send_html(){
echo '<!DOCTYPE html><html><head>'; echo '<!DOCTYPE html><html><head>';
echo "<title>$I[title]</title>"; echo "<title>$I[title]</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 '<style type="text/css">.red{color:red;} .green{color:green;} .up{background-color:#008000;} .down{background-color:#FF0000;} .promo{outline:medium solid #FFD700;} .list{display: inline-block; padding: 0px; margin: 0px;} .list li{display:inline;} .active{font-weight:bold;}</style>'; echo '<style type="text/css">.red{color:red;} .green{color:green;} .up{background-color:#008000;} .down{background-color:#FF0000;} .promo{outline:medium solid #FFD700;} .list{display: inline-block; padding: 0px; margin: 0px;} .list li{display:inline;} .active{font-weight:bold;}</style>';
echo '</head><body>'; echo '</head><body>';
echo "<h2>$I[title]</h2>"; echo "<h2>$I[title]</h2>";
@ -71,7 +72,6 @@ function send_html(){
echo '</body></html>'; echo '</body></html>';
exit; exit;
} }
echo '<p>I\'m not responsible for any content of websites linked here. Be careful and use your brain.</p><p>Do you want your address to be highlighted and featured at the top of the results? Send Bitcoins to <a href="bitcoin:1CHvjeMJum2Zfd3JEdb35RUEdz1jjQvdPT">1CHvjeMJum2Zfd3JEdb35RUEdz1jjQvdPT</a> and then <a href="/contact.php">tell me</a> your transaction ID and which address(es) you want to be highlighted. 0.025 BTC equals 10 days for one address. Any other amount can be calculated thereof.</p>';
//update onions description form //update onions description form
echo "<table><tr valign=\"top\"><td><form action=\"$_SERVER[SCRIPT_NAME]\" method=\"POST\">"; echo "<table><tr valign=\"top\"><td><form action=\"$_SERVER[SCRIPT_NAME]\" method=\"POST\">";
echo "<input type=\"hidden\" name=\"pg\" value=\"$_REQUEST[newpg]\">"; echo "<input type=\"hidden\" name=\"pg\" value=\"$_REQUEST[newpg]\">";
@ -143,7 +143,7 @@ function send_html(){
} }
++$cat; ++$cat;
} }
$num=$db->query('SELECT COUNT(*) FROM ' . PREFIX . 'phishing, ' . PREFIX . 'onions WHERE ' . PREFIX . "onions.id=onion_id AND address!='';")->fetch(PDO::FETCH_NUM); $num=$db->query('SELECT COUNT(*) FROM ' . PREFIX . 'phishing, ' . PREFIX . 'onions WHERE ' . PREFIX . "onions.id=onion_id AND address!='' AND timediff<604800;")->fetch(PDO::FETCH_NUM);
if($category==$cat){ if($category==$cat){
echo " <li class=\"active\"><a href=\"?cat=$cat&amp;lang=$language\">$I[phishingclones] ($num[0])</a></li>"; echo " <li class=\"active\"><a href=\"?cat=$cat&amp;lang=$language\">$I[phishingclones] ($num[0])</a></li>";
}else{ }else{
@ -153,7 +153,7 @@ function send_html(){
echo " <li>$I[removed] ($num[0])</li></ul><br><br>"; echo " <li>$I[removed] ($num[0])</li></ul><br><br>";
//List normal categories //List normal categories
echo "<ul class=\"list\"><li>$I[categories]:</li>"; echo "<ul class=\"list\"><li>$I[categories]:</li>";
$stmt=$db->prepare('SELECT COUNT(*) FROM ' . PREFIX . "onions WHERE category=? AND address!='' AND id NOT IN (SELECT onion_id FROM " . PREFIX . 'phishing);'); $stmt=$db->prepare('SELECT COUNT(*) FROM ' . PREFIX . "onions WHERE category=? AND address!='' AND id NOT IN (SELECT onion_id FROM " . PREFIX . 'phishing) AND timediff<604800;');
foreach($categories as $cat=>$name){ foreach($categories as $cat=>$name){
$stmt->execute(array($cat)); $stmt->execute(array($cat));
$num=$stmt->fetch(PDO::FETCH_NUM); $num=$stmt->fetch(PDO::FETCH_NUM);
@ -211,7 +211,7 @@ function send_html(){
$pagination=''; $pagination='';
} }
if(!empty($_REQUEST['q'])){//run search query if(!empty($_REQUEST['q'])){//run search query
$stmt=$db->prepare('SELECT address, lasttest, lastup, timeadded, description, locked, special FROM ' . PREFIX . "onions WHERE address!='' AND id NOT IN (SELECT onion_id FROM " . PREFIX . 'phishing) AND (description LIKE ? OR address LIKE ?) ORDER BY address;'); $stmt=$db->prepare('SELECT address, lasttest, lastup, timeadded, description, locked, special FROM ' . PREFIX . "onions WHERE address!='' AND id NOT IN (SELECT onion_id FROM " . PREFIX . 'phishing) AND timediff<604800 AND (description LIKE ? OR address LIKE ?) ORDER BY address;');
$query=htmlspecialchars($_REQUEST['q']); $query=htmlspecialchars($_REQUEST['q']);
$query="%$query%"; $query="%$query%";
$stmt->execute(array($query, $query)); $stmt->execute(array($query, $query));
@ -254,7 +254,7 @@ function send_html(){
echo '</body></html>'; echo '</body></html>';
} }
function get_table($stmt, &$numrows=0, $promoted=false){ function get_table(PDOStatement $stmt, &$numrows=0, $promoted=false){
global $I, $db, $language; global $I, $db, $language;
$time=time(); $time=time();
ob_start(); ob_start();
@ -319,7 +319,7 @@ function get_table($stmt, &$numrows=0, $promoted=false){
function print_phishing_table(){ function print_phishing_table(){
global $I, $db; global $I, $db;
echo "<table border=\"1\"><tr><th>$I[link]</th><th>$I[cloneof]</th><th>$I[lastup]</th></tr>"; echo "<table border=\"1\"><tr><th>$I[link]</th><th>$I[cloneof]</th><th>$I[lastup]</th></tr>";
$stmt=$db->query('SELECT address, original, lasttest, lastup FROM ' . PREFIX . 'onions, ' . PREFIX . 'phishing WHERE ' . PREFIX . "onions.id=onion_id AND address!='' ORDER BY onions.address;"); $stmt=$db->query('SELECT address, original, lasttest, lastup FROM ' . PREFIX . 'onions, ' . PREFIX . 'phishing WHERE ' . PREFIX . "onions.id=onion_id AND address!='' ORDER BY onions.address AND timediff<604800;");
while($link=$stmt->fetch(PDO::FETCH_ASSOC)){ while($link=$stmt->fetch(PDO::FETCH_ASSOC)){
if($link['lastup']===$link['lasttest']){ if($link['lastup']===$link['lasttest']){
$class='up'; $class='up';

View File

@ -26,6 +26,7 @@ include('common_config.php');
echo '<!DOCTYPE html><html><head>'; echo '<!DOCTYPE html><html><head>';
echo "<title>Daniel - $I[testtitle]</title>"; echo "<title>Daniel - $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=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 '<h2>Online-Test</h2>'; echo '<h2>Online-Test</h2>';

View File

@ -57,7 +57,7 @@ function check_links(&$onions, &$ch, $link){
} }
} }
function add_onions(&$onions, $db){ function add_onions(&$onions, PDO $db){
$stmt=$db->query('SELECT md5sum FROM ' . PREFIX . 'onions;'); $stmt=$db->query('SELECT md5sum FROM ' . PREFIX . 'onions;');
while($tmp=$stmt->fetch(PDO::FETCH_NUM)){ while($tmp=$stmt->fetch(PDO::FETCH_NUM)){
if(isSet($onions[$tmp[0]])){ if(isSet($onions[$tmp[0]])){