From cd9352163d1c8468e7eaefb4cba19dfd2e44255e Mon Sep 17 00:00:00 2001 From: Kazuki Przyborowski Date: Thu, 30 Jun 2011 23:09:18 +0000 Subject: [PATCH] Another small update/bug fix. :o git-svn-id: svn://svn.code.sf.net/p/intdb/svn/trunk@688 2b68903e-0b30-0410-9a39-a2e4f3c5be39 --- inc/misc/functions.php | 20 +++++++++++++++++++- inc/misc/useragents.php | 11 ++++++++++- inc/versioninfo.php | 6 +++--- 3 files changed, 32 insertions(+), 5 deletions(-) diff --git a/inc/misc/functions.php b/inc/misc/functions.php index 88664cf..ff730e6 100644 --- a/inc/misc/functions.php +++ b/inc/misc/functions.php @@ -11,7 +11,7 @@ Copyright 2004-2011 iDB Support - http://idb.berlios.de/ Copyright 2004-2011 Game Maker 2k - http://gamemaker2k.org/ - $FileInfo: functions.php - Last Update: 06/29/2011 SVN 686 - Author: cooldude2k $ + $FileInfo: functions.php - Last Update: 06/30/2011 SVN 689 - Author: cooldude2k $ */ $File3Name = basename($_SERVER['SCRIPT_NAME']); if ($File3Name=="functions.php"||$File3Name=="/functions.php") { @@ -73,6 +73,9 @@ $output = preg_replace("/&PHPSESSID/", "&PHPSESSID", $output); $qstrcode = htmlentities($Settings['qstr'], ENT_QUOTES, $Settings['charset']); $output = str_replace($Settings['qstr'].$SessName, $qstrcode.$SessName, $output); if($use_gzip!="on") { + if($Settings['send_pagesize']=="on") { + @header("Content-Length: ".decoct(strlen($output))); + @header("Content-MD5: ".base64_encode(md5($output))); } idb_log_maker($urlstatus,strlen($output)); echo $output; } if($use_gzip=="on") { @@ -80,6 +83,9 @@ if($use_gzip=="on") { $goutput = gzencode($output); } if($gzip_type=="deflate") { $goutput = gzcompress($output); } + if($Settings['send_pagesize']=="on") { + @header("Content-Length: ".decoct(strlen($goutput))); + @header("Content-MD5: ".base64_encode(md5($goutput))); } idb_log_maker($urlstatus,strlen($goutput)); echo $goutput; } } // Fix amp => (&) to & and gzip page @@ -94,6 +100,9 @@ $output = preg_replace("/&PHPSESSID/", "&PHPSESSID", $output); $qstrcode = htmlentities($Settings['qstr'], ENT_QUOTES, $Settings['charset']); $output = str_replace($Settings['qstr'].$SessName, $qstrcode.$SessName, $output); if($use_gzip!="on") { + if($Settings['send_pagesize']=="on") { + @header("Content-Length: ".decoct(strlen($output))); + @header("Content-MD5: ".base64_encode(md5($output))); } idb_log_maker($urlstatus,strlen($output)); echo $output; } if($use_gzip=="on") { @@ -101,6 +110,9 @@ if($use_gzip=="on") { $goutput = gzencode($output); } if($gzip_type=="deflate") { $goutput = gzcompress($output); } + if($Settings['send_pagesize']=="on") { + @header("Content-Length: ".decoct(strlen($goutput))); + @header("Content-MD5: ".base64_encode(md5($goutput))); } idb_log_maker($urlstatus,strlen($goutput)); echo $goutput; } } $Names['RJ'] = "Rene Johnson"; @@ -112,6 +124,9 @@ if(!isset($urlstatus)||!is_numeric($urlstatus)) { $urlstatus = 200; } $output = ob_get_clean(); if($gzip_type!="gzip") { if($gzip_type!="deflate") { $gzip_type = "gzip"; } } if($use_gzip!="on") { + if($Settings['send_pagesize']=="on") { + @header("Content-Length: ".decoct(strlen($output))); + @header("Content-MD5: ".base64_encode(md5($output))); } idb_log_maker($urlstatus,strlen($output)); echo $output; } if($use_gzip=="on") { @@ -119,6 +134,9 @@ if($use_gzip=="on") { $goutput = gzencode($output); } if($gzip_type=="deflate") { $goutput = gzcompress($output); } + if($Settings['send_pagesize']=="on") { + @header("Content-Length: ".decoct(strlen($goutput))); + @header("Content-MD5: ".base64_encode(md5($goutput))); } idb_log_maker($urlstatus,strlen($goutput)); echo $goutput; } } $foo="bar"; $$foo="foo"; diff --git a/inc/misc/useragents.php b/inc/misc/useragents.php index 92a1162..ad2b335 100644 --- a/inc/misc/useragents.php +++ b/inc/misc/useragents.php @@ -11,10 +11,15 @@ Copyright 2004-2011 iDB Support - http://idb.berlios.de/ Copyright 2004-2011 Game Maker 2k - http://gamemaker2k.org/ - $FileInfo: useragents.php - Last Update: 06/28/2011 SVN 684 - Author: cooldude2k $ + $FileInfo: useragents.php - Last Update: 06/30/2011 SVN 689 - Author: cooldude2k $ */ // User Agent Checker function user_agent_check($user_agent) { +global $Settings; +if(!isset($Settings['log_spiders_bots'])) { + $Settings['log_spiders_bots'] = "yes"; } +if($Settings['log_spiders_bots']!=="yes") { + return false; } if (preg_match("/".preg_quote("; 008/", "/")."/i", $user_agent)) { return "80legs"; } if (preg_match("/".preg_quote("AboutUsBot", "/")."/i", $user_agent)) { @@ -107,6 +112,8 @@ if (preg_match("/".preg_quote("Linguee Bot", "/")."/i", $user_agent)) { return "Linguee"; } if (preg_match("/".preg_quote("Lycos", "/")."/i", $user_agent)) { return "Lycos"; } +if (preg_match("/".preg_quote("LexxeBot", "/")."/i", $user_agent)) { + return "LexxeBot"; } if (preg_match("/".preg_quote("MJ12bot", "/")."/i", $user_agent)) { return "Majestic-12"; } if (preg_match("/".preg_quote("MLBot", "/")."/i", $user_agent)) { @@ -205,6 +212,8 @@ if (preg_match("/".preg_quote("WDG_Validator", "/")."/i", $user_agent)) { return "WDG Validator"; } if (preg_match("/".preg_quote("HTTP Compression Test", "/")."/i", $user_agent)) { return "WhatsMyIP"; } +if (preg_match("/".preg_quote("HuaweiSymantecSpider", "/")."/i", $user_agent)) { + return "Huawei Symantec"; } if (preg_match("/".preg_quote("WhatsMyIP.org", "/")."/i", $user_agent)) { return "WhatsMyIP"; } if (preg_match("/".preg_quote("WTABOT", "/")."/i", $user_agent)) { diff --git a/inc/versioninfo.php b/inc/versioninfo.php index b85fdc3..d89d489 100644 --- a/inc/versioninfo.php +++ b/inc/versioninfo.php @@ -11,7 +11,7 @@ Copyright 2004-2011 iDB Support - http://idb.berlios.de/ Copyright 2004-2011 Game Maker 2k - http://gamemaker2k.org/ - $FileInfo: versioninfo.php - Last Update: 06/29/2011 SVN 688 - Author: cooldude2k $ + $FileInfo: versioninfo.php - Last Update: 06/30/2011 SVN 689 - Author: cooldude2k $ */ $File3Name = basename($_SERVER['SCRIPT_NAME']); if ($File3Name=="versioninfo.php"||$File3Name=="/versioninfo.php") { @@ -27,8 +27,8 @@ function version_info($proname,$subver,$ver,$supver,$reltype,$svnver,$showsvn) { return $return_var; } // Version number and date stuff. :P $VER1[0] = 0; $VER1[1] = 4; $VER1[2] = 5; $VERFull[1] = $VER1[0].".".$VER1[1].".".$VER1[2]; -$VER2[0] = "Alpha"; $VER2[1] = "Al"; $VER2[2] = "SVN"; $SubVerN = 688; -$SVNDay[0] = 06; $SVNDay[1] = 29; $SVNDay[2] = 2011; $SVNDay[3] = $SVNDay[0]."/".$SVNDay[1]."/".$SVNDay[2]; +$VER2[0] = "Alpha"; $VER2[1] = "Al"; $VER2[2] = "SVN"; $SubVerN = 689; +$SVNDay[0] = 06; $SVNDay[1] = 30; $SVNDay[2] = 2011; $SVNDay[3] = $SVNDay[0]."/".$SVNDay[1]."/".$SVNDay[2]; $AltName = "RDB"; $AltName2 = "ReneeDB"; $RName = "iDB"; $SFName = "IntDB"; $RFullName = "Internet Discussion Boards"; $AltFullName = "Renee Discussion Boards"; $VerCheckName = "iDB"; $AltVerCheckName = "RDB"; -- 2.11.4.GIT