1 Commits

Author SHA1 Message Date
Sebastian Titz
63d289b6a9 markdown ready for repair 2021-08-26 09:19:32 +02:00
5 changed files with 99 additions and 129 deletions

View File

@@ -6,5 +6,5 @@ include_once ('string.php');
include_once ('numbers.php'); include_once ('numbers.php');
include_once ('mail.php'); include_once ('mail.php');
include_once ('debug.php'); include_once ('debug.php');
// include_once ('markdown.php'); include_once ('markdown.php');
?> ?>

View File

@@ -8,32 +8,11 @@ $_ips_crawler = array (
'104.155.85.', // google '104.155.85.', // google
'114.119.1', // petalbot '114.119.1', // petalbot
'185.191.171.', // semrush bot '185.191.171.', // semrush bot
'207.46.13.', // bing bot '207.46.13.124', // bing bot
'54.36.148.', // ahrefbot '54.36.148.', // ahrefbot
'54.36.149.', // ahrefbot
'216.244.66.196', // opensiteexplorer '216.244.66.196', // opensiteexplorer
'65.21.180.26', // seekport '65.21.180.26', // seekport
'81.209.177.145', // website-datenbank.de '81.209.177.145', // website-datenbank.de
'2a01:4f8:190:4244::2', // mj12bot '2a01:4f8:190:4244::2' // mj12bot
'144.76.15.153', // mj12bot
'192.99.5.225', // ...
'157.55.39.', // microsoft???
'2a01:4f8:162:43c5::2', // mj12bot
'85.25.177.', // abuse
'85.25.210.', // hosteurope abuse
'34.79.234.76', // google
'148.251.120.201' // mj12bot
); );
function checkHuman() {
global $_ips_crawler;
if (stripos ( $_SERVER ['HTTP_USER_AGENT'], 'bot' ) !== false) {
return false;
}
foreach ( $_ips_crawler as $np ) {
if (startsWith ( $_SERVER ['REMOTE_ADDR'], $np )) {
return false;
}
}
return true;
}
?> ?>

181
sql.php
View File

@@ -9,13 +9,13 @@ class SQL {
public $cnt_set = 0; public $cnt_set = 0;
public function __construct() { public function __construct() {
require_once ('secret.php'); require_once ('secret.php');
$this->m = $_m; $this->m = $_m;
$this->pre = $_m ['pre']; $this->pre = $_m ['pre'];
$this->salt = $_m ['salt']; $this->salt = $_m ['salt'];
if (SQL_LOG) if (SQL_LOG)
$this->f = fopen ( 'sql.log', 'w' ); $this->f = fopen ( 'sql.log', 'w' );
$this->h = new mysqli ( $_m ['host'], $_m ['user'], $_m ['pass'], $_m ['data'] ); $this->h = new mysqli ( $_m ['host'], $_m ['user'], $_m ['pass'], $_m ['data'] );
if ($this->h->connect_errno) { if ($this->h->connect_errno) {
return false; return false;
@@ -27,55 +27,51 @@ class SQL {
$this->cnt_get ++; $this->cnt_get ++;
if (SQL_LOG) if (SQL_LOG)
fputs ( $this->f, str_replace ( array ( fputs ( $this->f, str_replace ( array (
"\n", "\n",
" " " "
), array ( ), array (
' ', ' ',
'' ''
), $que ) . "\n" . print_r ( $p, true ) . "\n\n" ); ), $que ) . "\n" . print_r ( $p, true ) . "\n\n" );
$statement = $this->h->prepare ( $que ); $statement = $this->h->prepare ( $que );
if (is_array ( $p )) { switch (count ( $p )) {
switch (count ( $p )) { case 0 :
case 0 : break;
break; case 1 :
case 1 : $statement->bind_param ( $t, $p [0] );
$statement->bind_param ( $t, $p [0] ); break;
break; case 2 :
case 2 : $statement->bind_param ( $t, $p [0], $p [1] );
$statement->bind_param ( $t, $p [0], $p [1] ); break;
break; case 3 :
case 3 : $statement->bind_param ( $t, $p [0], $p [1], $p [2] );
$statement->bind_param ( $t, $p [0], $p [1], $p [2] ); break;
break; case 4 :
case 4 : $statement->bind_param ( $t, $p [0], $p [1], $p [2], $p [3] );
$statement->bind_param ( $t, $p [0], $p [1], $p [2], $p [3] ); break;
break; case 5 :
case 5 : $statement->bind_param ( $t, $p [0], $p [1], $p [2], $p [3], $p [4] );
$statement->bind_param ( $t, $p [0], $p [1], $p [2], $p [3], $p [4] ); break;
break; case 6 :
case 6 : $statement->bind_param ( $t, $p [0], $p [1], $p [2], $p [3], $p [4], $p [5] );
$statement->bind_param ( $t, $p [0], $p [1], $p [2], $p [3], $p [4], $p [5] ); break;
break; case 7 :
case 7 : $statement->bind_param ( $t, $p [0], $p [1], $p [2], $p [3], $p [4], $p [5], $p [6] );
$statement->bind_param ( $t, $p [0], $p [1], $p [2], $p [3], $p [4], $p [5], $p [6] ); break;
break; case 8 :
case 8 : $statement->bind_param ( $t, $p [0], $p [1], $p [2], $p [3], $p [4], $p [5], $p [6], $p [7] );
$statement->bind_param ( $t, $p [0], $p [1], $p [2], $p [3], $p [4], $p [5], $p [6], $p [7] ); break;
break; case 9 :
case 9 : $statement->bind_param ( $t, $p [0], $p [1], $p [2], $p [3], $p [4], $p [5], $p [6], $p [7], $p [8] );
$statement->bind_param ( $t, $p [0], $p [1], $p [2], $p [3], $p [4], $p [5], $p [6], $p [7], $p [8] ); break;
break; case 10 :
case 10 : $statement->bind_param ( $t, $p [0], $p [1], $p [2], $p [3], $p [4], $p [5], $p [6], $p [7], $p [8], $p [9] );
$statement->bind_param ( $t, $p [0], $p [1], $p [2], $p [3], $p [4], $p [5], $p [6], $p [7], $p [8], $p [9] ); break;
break;
}
} else {
$statement->bind_param ( $t, $p );
} }
$statement->execute (); $statement->execute ();
$ret = array (); $ret = array ();
// print_r($statement); // print_r($statement);
if (isset ( $statement->error ) && $statement->error != '') { if (isset ( $statement->error ) && $statement->error != '') {
if (SQL_LOG) if (SQL_LOG)
@@ -126,49 +122,60 @@ class SQL {
$statement = $this->h->prepare ( $que ); $statement = $this->h->prepare ( $que );
if (SQL_LOG) if (SQL_LOG)
fputs ( $this->f, str_replace ( array ( fputs ( $this->f, str_replace ( array (
"\n", "\n",
" " " "
), array ( ), array (
' ', ' ',
'' ''
), $que ) . "\n" . print_r ( $p, true ) . "\n\n" ); ), $que ) . "\n" . print_r ( $p, true ) . "\n\n" );
if (is_array ( $p )) { switch (count ( $p )) {
switch (count ( $p )) { case 0 :
case 0 : break;
break; case 1 :
case 1 : $statement->bind_param ( $t, $p [0] );
$statement->bind_param ( $t, $p [0] ); break;
break; case 2 :
case 2 : $statement->bind_param ( $t, $p [0], $p [1] );
$statement->bind_param ( $t, $p [0], $p [1] ); break;
break; case 3 :
case 3 : $statement->bind_param ( $t, $p [0], $p [1], $p [2] );
$statement->bind_param ( $t, $p [0], $p [1], $p [2] ); break;
break; case 4 :
case 4 : $statement->bind_param ( $t, $p [0], $p [1], $p [2], $p [3] );
$statement->bind_param ( $t, $p [0], $p [1], $p [2], $p [3] ); break;
break; case 5 :
case 5 : $statement->bind_param ( $t, $p [0], $p [1], $p [2], $p [3], $p [4] );
$statement->bind_param ( $t, $p [0], $p [1], $p [2], $p [3], $p [4] ); break;
break; case 6 :
case 6 : $statement->bind_param ( $t, $p [0], $p [1], $p [2], $p [3], $p [4], $p [5] );
$statement->bind_param ( $t, $p [0], $p [1], $p [2], $p [3], $p [4], $p [5] ); break;
break; case 7 :
case 7 : $statement->bind_param ( $t, $p [0], $p [1], $p [2], $p [3], $p [4], $p [5], $p [6] );
$statement->bind_param ( $t, $p [0], $p [1], $p [2], $p [3], $p [4], $p [5], $p [6] ); break;
break; case 8 :
case 8 : $statement->bind_param ( $t, $p [0], $p [1], $p [2], $p [3], $p [4], $p [5], $p [6], $p [7] );
$statement->bind_param ( $t, $p [0], $p [1], $p [2], $p [3], $p [4], $p [5], $p [6], $p [7] ); break;
break; case 9 :
case 9 : $statement->bind_param ( $t, $p [0], $p [1], $p [2], $p [3], $p [4], $p [5], $p [6], $p [7], $p [8] );
$statement->bind_param ( $t, $p [0], $p [1], $p [2], $p [3], $p [4], $p [5], $p [6], $p [7], $p [8] ); break;
break; case 10 :
case 10 : $statement->bind_param ( $t, $p [0], $p [1], $p [2], $p [3], $p [4], $p [5], $p [6], $p [7], $p [8], $p [9] );
$statement->bind_param ( $t, $p [0], $p [1], $p [2], $p [3], $p [4], $p [5], $p [6], $p [7], $p [8], $p [9] ); break;
break; case 11 :
} $statement->bind_param ( $t, $p [0], $p [1], $p [2], $p [3], $p [4], $p [5], $p [6], $p [7], $p [8], $p [9], $p [10] );
} else { break;
$statement->bind_param ( $t, $p ); case 12 :
$statement->bind_param ( $t, $p [0], $p [1], $p [2], $p [3], $p [4], $p [5], $p [6], $p [7], $p [8], $p [9], $p [10], $p [11] );
break;
case 13 :
$statement->bind_param ( $t, $p [0], $p [1], $p [2], $p [3], $p [4], $p [5], $p [6], $p [7], $p [8], $p [9], $p [10], $p [11], $p [12] );
break;
case 14 :
$statement->bind_param ( $t, $p [0], $p [1], $p [2], $p [3], $p [4], $p [5], $p [6], $p [7], $p [8], $p [9], $p [10], $p [11], $p [12], $p [13] );
break;
case 15 :
$statement->bind_param ( $t, $p [0], $p [1], $p [2], $p [3], $p [4], $p [5], $p [6], $p [7], $p [8], $p [9], $p [10], $p [11], $p [12], $p [13], $p [14] );
break;
} }
$statement->execute (); $statement->execute ();
if (isset ( $statement->error ) && $statement->error != '') { if (isset ( $statement->error ) && $statement->error != '') {
@@ -176,7 +183,7 @@ class SQL {
fputs ( $this->f, $statement->error ); fputs ( $this->f, $statement->error );
return false; return false;
} }
if ($id) { if ($id) {
return $statement->insert_id; return $statement->insert_id;
} else { } else {

View File

@@ -7,8 +7,7 @@ function umlaute($str) {
'ä', 'ä',
'ö', 'ö',
'ü', 'ü',
'ß', 'ß'
'&'
), array ( ), array (
'Ä', 'Ä',
'Ö', 'Ö',
@@ -16,8 +15,7 @@ function umlaute($str) {
'ä', 'ä',
'ö', 'ö',
'ü', 'ü',
'ß', 'ß'
'&'
), $str ); ), $str );
} }
function chk($str) { function chk($str) {

View File

@@ -1,14 +0,0 @@
<?php
function sendToTroy($data) {
$url = 'https://troy-grunt.de/api.php';
// use key 'http' even if you send the request to https://...
$options = array (
'http' => array (
'method' => 'POST',
'content' => json_encode ( $data )
)
);
$context = stream_context_create ( $options );
return file_get_contents ( $url, false, $context );
}
?>