<?php
error_reporting(E_ALL ^ E_DEPRECATED);
mysqli_report(MYSQLI_REPORT_OFF);
include "include/variables.php";
include "include/functions.php";
include "include/errors.php";
include "include/getip.php";
$PHP_SELF=$_SERVER['PHP_SELF'];
if (isset($_SERVER['HTTP_ACCEPT_ENCODING']) && substr_count($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip')) {
if (ob_get_length()) ob_end_clean();
ob_start("ob_gzhandler");
}
else ob_start();
$allow=true;
include "include/bans.php";
include "include/ipfilter.php";
if ($allow) {
mt_srand((double)microtime()*1000000);
include "include/iplog.php";
include "include/browser.php";
if (!isset($_GET['debug'])) {
ob_start();
}
$br = new Browser;
$text="";
if(isset($_GET['agent'])) $br->setUserAgent($_GET['agent']);
$text="Your IP: $ip".($host?(" (".$host.")"):"").(!empty($proxy)?("\nProxy: ".$proxy):"");
$text.="\nYour Browser: ".$br->getBrowser()." ".$br->getVersion()." OS: ".$br->GetPlatform();
$font="./fonts/georgia.ttf";
$size=11; $angle = 0;
$W=600;
$H=200;
$lines=explode("\n",$text);
$LW=Array();
$LH=Array();
foreach($lines as $line) {
$testimg = imagecreatetruecolor($W, $H);
imageantialias($testimg,true);
$testcolor = imagecolorallocate ($testimg, 255, 255, 255);
$testbg = imagecolorallocate ($testimg, 0, 0, 0);
imagefill($testimg, 0, 0, $testbg);
imagettftext($testimg, $size, $angle,100,100,$testcolor,$font,$line);
$min_x=$W;
$min_y=$H;
$max_x=0;
$max_y=0;
for($x = 0; $x < $W; $x++)
for($y = 0; $y < $H; $y++)
if (imagecolorat($testimg, $x, $y) !== $testbg){
if($min_x > $x) $min_x = $x;
if($min_y > $y) $min_y = $y;
if($max_x < $x) $max_x = $x;
if($max_y < $y) $max_y = $y;
}
$LW[]=$max_x-$min_x;
$LH[]=$max_y-$min_y;
imagedestroy($testimg);
}
$W=max($LW)+6;
$H=array_sum($LH)+6;
if (isset($_GET['debug'])) echo "$W $H\n";
$image = imagecreatetruecolor($W, $H);
$c_min=0;
$c_max=164;
$b_min=240;
$b_max=255;
$back = imagecolorallocate ($image,
mt_rand($b_min,$b_max),
mt_rand($b_min,$b_max),
mt_rand($b_min,$b_max)
);
$color = imagecolorallocate ($image,
mt_rand($c_min,$c_max),
mt_rand($c_min,$c_max),
mt_rand($c_min,$c_max)
);
imagefill($image, 0, 0, $back);
imagerectangle($image, 0, 0, $W-1, $H-1, $color);
imagefilter($image, IMG_FILTER_SMOOTH, 6);
$x=1;
$y=1;
for($i=0; $i< count($lines); $i++) {
$y+=$LH[$i]+3;
$color = imagecolorallocate ($image,
mt_rand($c_min,$c_max),
mt_rand($c_min,$c_max),
mt_rand($c_min,$c_max)
);
imagettftext($image, $size, $angle, $x, $y-4, $color, $font, $lines[$i]);
}
if (!isset($_GET['debug'])) header("Content-Type: image/jpeg");
else header("Content-Type: text/plain");
$name=explode(".", basename($PHP_SELF));
if (!isset($_GET['debug'])) {
header("Content-disposition:inline; filename=".$name[0].".jpg");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header('Pragma: no-cache');
header("Expires: -1");
imagejpeg($image);
imagedestroy($image);
} else {
ob_end_flush();
}
} else echo "BANNED";
?>
You can also check other includes below (some files are hidden as they are in exclusion list):
functions.php
errors.php
getip.php
bans.php
ipfilter.php
iplog.php
browser.php