From 2e8f51080c704fc7f83fe3273fe5d8b9f56462cd Mon Sep 17 00:00:00 2001 From: Daniel Winzen Date: Wed, 28 Sep 2016 20:51:43 +0200 Subject: [PATCH] Bugfix and minor improvements --- admin.php | 4 ++++ onions.php | 12 ++++++------ test.php | 1 + update.php | 2 +- 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/admin.php b/admin.php index 8b30042..9839bb1 100644 --- a/admin.php +++ b/admin.php @@ -19,6 +19,9 @@ */ 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'){ exit; // headers sent, no further processing needed } @@ -32,6 +35,7 @@ asort($categories); echo ''; echo "$I[admintitle]"; echo ''; +echo ''; echo ''; echo ''; echo "

$I[admintitle]

"; diff --git a/onions.php b/onions.php index 1c6230a..c76dd5a 100644 --- a/onions.php +++ b/onions.php @@ -61,6 +61,7 @@ function send_html(){ echo ''; echo "$I[title]"; echo ''; + echo ''; echo ''; echo ''; echo "

$I[title]

"; @@ -71,7 +72,6 @@ function send_html(){ echo ''; exit; } - echo '

I\'m not responsible for any content of websites linked here. Be careful and use your brain.

Do you want your address to be highlighted and featured at the top of the results? Send Bitcoins to 1CHvjeMJum2Zfd3JEdb35RUEdz1jjQvdPT and then tell me 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.

'; //update onions description form echo "
"; echo ""; @@ -143,7 +143,7 @@ function send_html(){ } ++$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){ echo "
  • $I[phishingclones] ($num[0])
  • "; }else{ @@ -153,7 +153,7 @@ function send_html(){ echo "
  • $I[removed] ($num[0])


  • "; //List normal categories echo "
    • $I[categories]:
    • "; - $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){ $stmt->execute(array($cat)); $num=$stmt->fetch(PDO::FETCH_NUM); @@ -211,7 +211,7 @@ function send_html(){ $pagination=''; } 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="%$query%"; $stmt->execute(array($query, $query)); @@ -254,7 +254,7 @@ function send_html(){ echo ''; } -function get_table($stmt, &$numrows=0, $promoted=false){ +function get_table(PDOStatement $stmt, &$numrows=0, $promoted=false){ global $I, $db, $language; $time=time(); ob_start(); @@ -319,7 +319,7 @@ function get_table($stmt, &$numrows=0, $promoted=false){ function print_phishing_table(){ global $I, $db; echo ""; - $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)){ if($link['lastup']===$link['lasttest']){ $class='up'; diff --git a/test.php b/test.php index 7ef261f..976bcd9 100644 --- a/test.php +++ b/test.php @@ -26,6 +26,7 @@ include('common_config.php'); echo ''; echo "Daniel - $I[testtitle]"; echo ''; +echo ''; echo ''; echo ''; echo '

      Online-Test

      '; diff --git a/update.php b/update.php index 603c15a..a2edb6e 100644 --- a/update.php +++ b/update.php @@ -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;'); while($tmp=$stmt->fetch(PDO::FETCH_NUM)){ if(isSet($onions[$tmp[0]])){
      $I[link]$I[cloneof]$I[lastup]