<?php
-// $Id: spam.ini.php,v 1.82 2007/04/12 14:31:53 henoheno Exp $
+// $Id: spam.ini.php,v 1.83 2007/04/22 08:04:19 henoheno Exp $
// Spam-related setting
//
// Reference:
// Spamdexing http://en.wikipedia.org/wiki/Spamdexing
-// NOTE for goodhost and badhost:
+// NOTE:
// 'example.org' prohibits both 'example.org' AND 'www.example.org'.
// '*.example.org' prohibits all subdomains and hosts EXCEPT 'www.example.org'.
// '.example.org' prohibits ALL FQDN related 'example.org'.
+// NOTE for badhost (only):
+// 'unique_name' = array('a.example.org', 'b.example.org') is treated as a group 'unique_name'.
+
+
+// List of the lists
+$blocklist['list'] = array(
+ 'goodhost' => FALSE,
+ 'badhost A-1' => TRUE,
+ 'badhost A-2' => TRUE,
+ 'badhost B-1' => TRUE,
+ 'badhost B-2' => TRUE,
+ 'badhost C' => TRUE,
+ 'badhost' => TRUE,
+);
+
+
$blocklist['goodhost'] = array(
'IANA-examples' => '#^(?:.*\.)?example\.(?:com|net|org)$#',
);
-// NOTE for badhost (only):
-// 'unique_name' = array('a.example.org', 'b.example.org') is treated as a group 'unique_name'.
-$blocklist['badhost'] = array(
+// A: Sample setting of
+// Existing URI redirection or masking services
- // A: Sample setting of
- // Existing URI redirection or masking services
+$blocklist['badhost A-1'] = array(
// A-1: General redirection services -- by HTML meta, HTML frame, JavaScript,
// web-based proxy, DNS subdomains, etc
'*.zu5.net',
'zuso.tw',
'*.zwap.to',
+);
+
+$blocklist['badhost A-2'] = array(
// A-2: Dynamic DNS, Dynamic IP services, DNS vulnerabilities, or another DNS cases
//
//'*.zenno.info',
//'.cm', // 'Cameroon' ccTLD, sometimes used as typo of '.com'
// and all non-recorded domains redirect to 'agoga.com' now
+);
- // B: Sample setting of:
- // Jacked (taken advantage of) and cleaning-less sites
- //
- // Please notify us about this list with reason:
- // http://pukiwiki.sourceforge.jp/dev/?BugTrack2%2F208
+// B: Sample setting of:
+// Jacked (taken advantage of) and cleaning-less sites
+//
+// Please notify us about this list with reason:
+// http://pukiwiki.sourceforge.jp/dev/?BugTrack2%2F208
+
+$blocklist['badhost B-1'] = array(
// B-1: Web spaces
//
'*.your-websites.net',
'*.web-space.ws',
),
+);
+
+
+$blocklist['badhost B-2'] = array(
// B-2: Jacked contents, something implanted
// (e.g. some sort of blog comments, BBSes, forums, wikis)
'yasushi.site.ne.jp', // One of mixedmedia.net'
'youthpeer.org',
'*.zenburger.com',
+);
+
+$blocklist['badhost C'] = array(
// C: Sample setting of:
// Exclusive spam domains
),
-
// C-2: Lonely domains (buddies not found yet)
'.0721-4404.com',
'.0nline-porno.info', // by Timyr (timyr at narod.ru)
'.nana.co.il',
),
'.mylexus.info', // by Homer Simpson (simhomer12300 at mail.com), Redirect to Google
+);
+
+$blocklist['badhost'] = array(
// D: Sample setting of
// "third party in good faith"s
//
<?php
-// $Id: spam.php,v 1.130 2007/04/11 13:13:33 henoheno Exp $
+// $Id: spam.php,v 1.131 2007/04/22 08:04:19 henoheno Exp $
// Copyright (C) 2006-2007 PukiWiki Developers Team
// License: GPL v2 or (at your option) any later version
//
// '*.blogspot.com', // Blog services's subdomains (only)
// 'IANA-examples' => '#^(?:.*\.)?example\.(?:com|net|org)$#',
// );
- foreach(array('goodhost', 'badhost') as $_list) {
+ if (isset($blocklist['list'])) {
+ $regexs['list'] = & $blocklist['list'];
+ } else {
+ // Default
+ $blocklist['list'] = array(
+ 'goodhost' => FALSE,
+ 'badhost' => TRUE,
+ );
+ }
+ foreach(array_keys($blocklist['list']) as $_list) {
if (! isset($blocklist[$_list])) continue;
foreach ($blocklist[$_list] as $key => $value) {
if (is_array($value)) {
get_blocklist_add($regexs[$_list], $key, $value);
}
}
+ unset($blocklist[$_list]);
}
}
}
} else {
$array[$value] = '/^' . generate_host_regex($value, '/') . '$/i';
}
-}
+}
function is_badhost($hosts = array(), $asap = TRUE, & $remains)
{
}
if (empty($hosts)) return $result;
- foreach (get_blocklist('goodhost') as $regex) {
- $hosts = preg_grep_invert($regex, $hosts);
- }
- if (empty($hosts)) return $result;
-
- foreach (get_blocklist('badhost') as $label => $regex) {
- if (is_array($regex)) {
- $result[$label] = array();
- foreach($regex as $_label => $_regex) {
- if (is_badhost_avail($_label, $_regex, $hosts, $result[$label]) && $asap) {
- break;
+ foreach(get_blocklist('list') as $key=>$value){
+ if ($value) {
+ foreach (get_blocklist($key) as $label => $regex) {
+ if (is_array($regex)) {
+ $result[$label] = array();
+ foreach($regex as $_label => $_regex) {
+ if (is_badhost_avail($_label, $_regex, $hosts, $result[$label]) && $asap) {
+ break;
+ }
+ }
+ if (empty($result[$label])) unset($result[$label]);
+ } else {
+ if (is_badhost_avail($label, $regex, $hosts, $result) && $asap) {
+ break;
+ }
}
}
- if (empty($result[$label])) unset($result[$label]);
} else {
- if (is_badhost_avail($label, $regex, $hosts, $result) && $asap) {
- break;
+ foreach (get_blocklist($key) as $regex) {
+ $hosts = preg_grep_invert($regex, $hosts);
}
+ if (empty($hosts)) return $result;
}
}
$remains = $hosts;
-
return $result;
}