OSDN Git Service

whois_responsibility()
[pukiwiki/pukiwiki_sandbox.git] / spam / spam.php
index caf7d98..7912cf7 100644 (file)
@@ -1,5 +1,5 @@
 <?php
-// $Id: spam.php,v 1.165 2007/05/20 02:22:56 henoheno Exp $
+// $Id: spam.php,v 1.176 2007/06/14 14:57:37 henoheno Exp $
 // Copyright (C) 2006-2007 PukiWiki Developers Team
 // License: GPL v2 or (at your option) any later version
 //
@@ -127,17 +127,20 @@ function strings($binary = '', $min_len = 4, $ignore_space = FALSE)
                        ),
                         $binary);
        } else {
+               // Remove "\0" etc. Preserve readable spaces if possible.
                $binary = preg_replace('/(?:[^[:graph:][:space:]]|[\r])+/s', "\n", $binary);
        }
 
        if ($min_len > 1) {
                $min_len = min(1024, intval($min_len));
-               $binary = 
-                       implode("\n",
-                               preg_grep('/^.{' . $min_len . ',}/S',
-                                       explode("\n", $binary)
-                               )
-                       );
+               $regex = '/^.{' . $min_len . ',}/S';
+               if (is_array($binary)) {
+                       foreach(array_keys($binary) as $key) {
+                               $binary[$key] = implode("\n", preg_grep($regex, explode("\n", $binary[$key])));
+                       }
+               } else {
+                       $binary = implode("\n", preg_grep($regex, explode("\n", $binary)));
+               }
        }
 
        return $binary;
@@ -1018,17 +1021,14 @@ function generate_host_regex($string = '', $divider = '/')
 
 function get_blocklist($list = '')
 {
-       static $f_dispose = FALSE, $regexes;
+       static $regexes;
 
        if ($list === NULL) {
-               $f_dispose = TRUE;
-               $regexes   = NULL;      // Unset
+               $regexes = NULL;        // Unset
                return array();
        }
 
        if (! isset($regexes)) {
-               if ($f_dispose === TRUE) die(__FUNCTION__ . '(): Memory already disposed');
-
                $regexes = array();
                if (file_exists(SPAM_INI_FILE)) {
                        $blocklist = array();
@@ -1409,8 +1409,10 @@ function array_flat_leaves($array, $unique = TRUE)
 }
 
 // An array() to an array leaf
-function array_leaf($array = array('A', 'B', 'C.D'), $stem = FALSE, $edge = array())
+function array_leaf($array = array('A', 'B', 'C.D'), $stem = FALSE, $edge = TRUE)
 {
+       if (! is_array($array)) return $array;
+
        $leaf = array();
        $tmp  = & $leaf;
        foreach($array as $arg) {
@@ -1503,22 +1505,22 @@ function summarize_detail_newtral($progress = array())
                foreach($progress['hosts'] as $value) {
                        $tmp = array_merge_recursive(
                                $tmp,
-                               array_leaf(explode('.', delimiter_reverse($value) . '.'), TRUE, $value)
+                               array_leaf(explode('.', delimiter_reverse($value)), TRUE, $value)
                        );
                }
-               ksort($tmp, SORT_STRING);
 
-               separate_and_joinkey_leaves($tmp, '.', TRUE, TRUE);
-               separate_and_joinkey_leaves($tmp, '.', TRUE, FALSE);
-               separate_and_joinkey_leaves($tmp, '.', TRUE, FALSE);
-               //separate_and_joinkey_leaves($tmp, '.', TRUE, FALSE);
+//var_dump($tmp);
+// TODO: IP address 1.2.3.4 => "0"-3-2-1 by array_shrinkbranch_leaves()
 
+               array_shrinkbranch_leaves($tmp, '.', TRUE); // "domain.tld"
+               array_joinbranch_leaf($tmp, '.', 0, TRUE);
                foreach($tmp as $key => $value) {
                        if (is_array($value)) {
-                               ksort($tmp[$key]);
-               //              $tmp[$key] = implode(', ', array_flat_leaves($value));
+                               ksort($tmp[$key], SORT_STRING);
+                               $tmp[$key] = implode(', ', array_flat_leaves($value));
                        }
                }
+               ksort($tmp, SORT_STRING);
 
                $result = var_export_shrink($tmp, TRUE, TRUE);
        }
@@ -1526,41 +1528,548 @@ function summarize_detail_newtral($progress = array())
        return $result;
 }
 
-function separate_and_joinkey_leaves(
-       & $array,       // array('A' => array('B' => 'C.D')),
-       $delim = '.', $reversejoin = FALSE, $allowmulti = FALSE)
+// array('F' => array('B' => array('C' => array('d' => array('' => 'foobar')))))
+// to
+// array('F.B.C.d.' => 'foobar')
+function array_joinbranch_leaf(& $array, $delim = '.', $limit = 0, $reverse = FALSE)
 {
-       if (! is_array($array)) return $array;
-
        $result = array();
+       if (! is_array($array)) return $result; // Nothing to do
+
+       $limit  = max(0, intval($limit));
+       $cstack = array();
+
+       foreach(array_keys($array) as $key) {
+               $kstack = array();
+               $k      = -1;
+
+               $single = array($key => & $array[$key]);        // Keep it single
+               $cursor = & $single;
+               while(is_array($cursor) && count($cursor) == 1) {       // Once
+                       ++$k;
+                       $kstack[] = key($cursor);
+                       $cursor   = & $cursor[$kstack[$k]];
+                       if ($limit != 0 && $k == $limit) break;
+               }
+
+               // Relink
+               if ($k != 0) {
+                       if ($reverse) $kstack = array_reverse($kstack);
+                       $joinkey = implode($delim, $kstack);
+
+                       unset($array[$key]);
+                       $array[$joinkey]  = & $cursor;
+                       $result[$joinkey] = $k + 1;     // Key seems not an single array => joined length
+               }
+       }
+
+       return $result;
+}
+
+
+// array('A' => array('B' => 'C')) to
+// array('A.B' => 'C')
+// array(
+//     'A' => array(
+//             'B' => array(
+//                     'C' => array(
+//                             'D' => '1'
+//                     ),
+//             ),
+//     ),
+//     'G' => array(
+//             'H' => '2'
+//     ),
+// )
+// to
+// array (
+//     'G.H'     => '2',
+//     'A.B.C.D' => '1',
+// )
+function array_shrinkbranch_leaves(& $array, $delim = '.', $reverse = FALSE, $recurse = FALSE)
+{
+       $result = 0;
+       if (! is_array($array) || empty($array)) return $result;
+
        foreach(array_keys($array) as $key) {
-               if (! is_array($array[$key]) || (! $allowmulti && count($array[$key]) > 1)) {
-                       $result[$key] = & $array[$key]; // Do nothing
+               $branch = & $array[$key];
+               if (! is_array($branch) || empty($branch)) continue;
+
+               foreach(array_keys($branch) as $bkey) {
+                       $joinkey = $reverse ?
+                               $bkey . $delim . $key :
+                               $key  . $delim . $bkey;
+                       $array[$joinkey] = & $branch[$bkey];
+                       unset($array[$key]);
+                       ++$result;
+               }
+       }
+
+       // Rescan (Recurse)
+       if ($recurse && $result) {
+               $result = array_shrinkbranch_leaves($array, $delim, $reverse, $recurse);
+       }
+
+       return $result; // Tell me how many
+}
+//$a = array (
+//     'edu' => array (
+//             'berkeley' => array (
+//                     'polisci' => array (
+//                             '' => 'polisci.berkeley.edu',
+//                     ),
+//             ),
+//             'cmich' => array (
+//                     'rso' => array (
+//                             '' => 'rso.cmich.edu',
+//                     ),
+//             ),
+//     ),
+//);
+//array_shrinkbranch_leaves($a, '.', TRUE);
+//var_export($a);
+
+//$a = array (
+//     '4' => array (
+//             '5' => array (
+//                     '6' => array (
+//                             '' => '7.8.9',
+//                     ),
+//             ),
+//     ),
+//);
+//array_shrinkbranch_leaves($a, '.', TRUE);
+//var_export($a);
+
+
+
+// Check responsibility-root of the FQDN
+// 'foo.bar.example.com'        => 'example.com'        (.com        has the last whois for it)
+// 'foo.bar.example.au'         => 'example.au'         (.au         has the last whois for it)
+// 'foo.bar.example.edu.au'     => 'example.edu.au'     (.edu.au     has the last whois for it)
+// 'foo.bar.example.act.edu.au' => 'example.act.edu.au' (.act.edu.au has the last whois for it)
+function whois_responsibility($fqdn = 'foo.bar.example.com', $implicit = TRUE)
+{
+       // Domains who have 2nd and/or 3rd level domains
+       static $domain = array(
+
+               // ccTLD: Australia
+               // http://www.auda.org.au/
+               // NIC  : http://www.aunic.net/
+               // Whois: http://www.ausregistry.com.au/
+               'au' => array(
+                       // .au Second Level Domains
+                       // http://www.auda.org.au/domains/
+                       'asn'   => TRUE,
+                       'com'   => TRUE,
+                       'conf'  => TRUE,
+                       'csiro' => TRUE,
+                       'edu'   => array(       // http://www.domainname.edu.au/
+                               'act' => TRUE,
+                               'nt'  => TRUE,
+                               'nsw' => TRUE,
+                               'qld' => TRUE,
+                               'sa'  => TRUE,
+                               'tas' => TRUE,
+                               'vic' => TRUE,
+                               'wa'  => TRUE,
+                       ),
+                       'gov'   => array(
+                               'act' => TRUE,  // Australian Capital Territory
+                               'nt'  => TRUE,  // Northern Territory
+                               'nsw' => TRUE,  // New South Wales
+                               'qld' => TRUE,  // Queensland
+                               'sa'  => TRUE,  // South Australia
+                               'tas' => TRUE,  // Tasmania
+                               'vic' => TRUE,  // Victoria
+                               'wa'  => TRUE,  // Western Australia
+                       ),
+                       'id'    => TRUE,
+                       'net'   => TRUE,
+                       'org'   => TRUE,
+                       'info'  => TRUE,
+               ),
+
+               // ccTLD: China
+               // NIC  : http://www.cnnic.net.cn/en/index/
+               // Whois: http://ewhois.cnnic.cn/
+               'cn' => array(
+                       // Provisional Administrative Rules for Registration of Domain Names in China
+                       // http://www.cnnic.net.cn/html/Dir/2003/11/27/1520.htm
+
+                       // Organizational
+                       'ac'  => TRUE,
+                       'com' => TRUE,
+                       'edu' => TRUE,
+                       'gov' => TRUE,
+                       'net' => TRUE,
+                       'org' => TRUE,
+
+                       // Geographic
+                       'ah' => TRUE,
+                       'bj' => TRUE,
+                       'cq' => TRUE,
+                       'fj' => TRUE,
+                       'gd' => TRUE,
+                       'gs' => TRUE,
+                       'gx' => TRUE,
+                       'gz' => TRUE,
+                       'ha' => TRUE,
+                       'hb' => TRUE,
+                       'he' => TRUE,
+                       'hi' => TRUE,
+                       'hk' => TRUE,
+                       'hl' => TRUE,
+                       'hn' => TRUE,
+                       'jl' => TRUE,
+                       'js' => TRUE,
+                       'jx' => TRUE,
+                       'ln' => TRUE,
+                       'mo' => TRUE,
+                       'nm' => TRUE,
+                       'nx' => TRUE,
+                       'qh' => TRUE,
+                       'sc' => TRUE,
+                       'sd' => TRUE,
+                       'sh' => TRUE,
+                       'sn' => TRUE,
+                       'sx' => TRUE,
+                       'tj' => TRUE,
+                       'tw' => TRUE,
+                       'xj' => TRUE,
+                       'xz' => TRUE,
+                       'yn' => TRUE,
+                       'zj' => TRUE,
+               ),
+
+               // ccTLD: South Korea
+               // NIC  : http://www.nic.or.kr/english/
+               // Whois: http://whois.nida.or.kr/english/
+               'kr' => array(
+                       // .kr domain policy [appendix 1] : Qualifications for Second Level Domains
+                       // http://domain.nida.or.kr/eng/policy.jsp
+
+                       // Organizational
+                       'co'  => TRUE,
+                       'ne ' => TRUE,
+                       'or ' => TRUE,
+                       're ' => TRUE,
+                       'pe'  => TRUE,
+                       'go ' => TRUE,
+                       'mil' => TRUE,
+                       'ac'  => TRUE,
+                       'hs'  => TRUE,
+                       'ms'  => TRUE,
+                       'es'  => TRUE,
+                       'sc'  => TRUE,
+                       'kg'  => TRUE,
+
+                       // Geographic
+                       'seoul'     => TRUE,
+                       'busan'     => TRUE,
+                       'daegu'     => TRUE,
+                       'incheon'   => TRUE,
+                       'gwangju'   => TRUE,
+                       'daejeon'   => TRUE,
+                       'ulsan'     => TRUE,
+                       'gyeonggi'  => TRUE,
+                       'gangwon'   => TRUE,
+                       'chungbuk'  => TRUE,
+                       'chungnam'  => TRUE,
+                       'jeonbuk'   => TRUE,
+                       'jeonnam'   => TRUE,
+                       'gyeongbuk' => TRUE,
+                       'gyeongnam' => TRUE,
+                       'jeju'      => TRUE,
+               ),
+
+               // ccTLD: Japan
+               // NIC  : http://jprs.co.jp/en/
+               // Whois: http://whois.jprs.jp/en/
+               'jp' => array(
+                       // Guide to JP Domain Name
+                       // http://jprs.co.jp/en/jpdomain.html
+
+                       // Organizational
+                       'ac' => TRUE,
+                       'ad' => TRUE,
+                       'co' => TRUE,
+                       'go' => TRUE,
+                       'gr' => TRUE,
+                       'lg' => TRUE,
+                       'ne' => TRUE,
+                       'or' => TRUE,
+
+                       // Geographic
+                       //
+                       // Examples for 3rd level domains
+                       //'kumamoto'  => array(
+                       //      // http://www.pref.kumamoto.jp/link/list.asp#4
+                       //      'amakusa'   => TRUE,
+                       //      'hitoyoshi' => TRUE,
+                       //      'jonan'     => TRUE,
+                       //      'kumamoto'  => TRUE,
+                       //      ...
+                       //),
+                       'aichi'     => TRUE,
+                       'akita'     => TRUE,
+                       'aomori'    => TRUE,
+                       'chiba'     => TRUE,
+                       'ehime'     => TRUE,
+                       'fukui'     => TRUE,
+                       'fukuoka'   => TRUE,
+                       'fukushima' => TRUE,
+                       'gifu'      => TRUE,
+                       'gunma'     => TRUE,
+                       'hiroshima' => TRUE,
+                       'hokkaido'  => TRUE,
+                       'hyogo'     => TRUE,
+                       'ibaraki'   => TRUE,
+                       'ishikawa'  => TRUE,
+                       'iwate'     => TRUE,
+                       'kagawa'    => TRUE,
+                       'kagoshima' => TRUE,
+                       'kanagawa'  => TRUE,
+                       'kawasaki'  => TRUE,
+                       'kitakyushu'=> TRUE,
+                       'kobe'      => TRUE,
+                       'kochi'     => TRUE,
+                       'kumamoto'  => TRUE,
+                       'kyoto'     => TRUE,
+                       'mie'       => TRUE,
+                       'miyagi'    => TRUE,
+                       'miyazaki'  => TRUE,
+                       'nagano'    => TRUE,
+                       'nagasaki'  => TRUE,
+                       'nagoya'    => TRUE,
+                       'nara'      => TRUE,
+                       'niigata'   => TRUE,
+                       'oita'      => TRUE,
+                       'okayama'   => TRUE,
+                       'okinawa'   => TRUE,
+                       'osaka'     => TRUE,
+                       'saga'      => TRUE,
+                       'saitama'   => TRUE,
+                       'sapporo'   => TRUE,
+                       'sendai'    => TRUE,
+                       'shiga'     => TRUE,
+                       'shimane'   => TRUE,
+                       'shizuoka'  => TRUE,
+                       'tochigi'   => TRUE,
+                       'tokushima' => TRUE,
+                       'tokyo'     => TRUE,
+                       'tottori'   => TRUE,
+                       'toyama'    => TRUE,
+                       'wakayama'  => TRUE,
+                       'yamagata'  => TRUE,
+                       'yamaguchi' => TRUE,
+                       'yamanashi' => TRUE,
+                       'yokohama'  => TRUE,
+               ),
+
+               // ccTLD: Ukraine
+               // NIC  : http://www.nic.net.ua/
+               // Whois: http://whois.com.ua/
+               'ua' => array(
+                       // policy for alternative 2nd level domain names (a2ld)
+                       // http://www.nic.net.ua/doc/a2ld
+                       // http://whois.com.ua/
+                       'cherkassy'  => TRUE,   // www.cherkassy.ua
+                       'chernigov'  => TRUE,   
+                       'chernovtsy' => TRUE,
+                       'ck'         => TRUE,
+                       'cn'         => TRUE,
+                       'com'        => TRUE,
+                       'crimea'     => TRUE,
+                       'cv'         => TRUE,
+                       'dn'         => TRUE,
+                       'dnepropetrovsk' => TRUE,
+                       'donetsk'    => TRUE,
+                       'dp'         => TRUE,
+                       'edu'        => TRUE,
+                       'gov'        => TRUE,
+                       'if'         => TRUE,
+                       'ivano-frankivsk' => TRUE,
+                       'kh'         => TRUE,
+                       'kharkov'    => TRUE,
+                       'kherson'    => TRUE,
+                       'kiev'       => TRUE,
+                       'kirovograd' => TRUE,
+                       'km'         => TRUE,
+                       'kr'         => TRUE,
+                       'ks'         => TRUE,
+                       'lg'         => TRUE,
+                       'lugansk'    => TRUE,
+                       'lutsk'      => TRUE,
+                       'lviv'       => TRUE,
+                       'mk'         => TRUE,
+                       'net'        => TRUE,
+                       'nikolaev'   => TRUE,
+                       'od'         => TRUE,
+                       'odessa'     => TRUE,
+                       'org'        => TRUE,
+                       'pl'         => TRUE,
+                       'poltava'    => TRUE,
+                       'rovno'      => TRUE,
+                       'rv'         => TRUE,
+                       'sebastopol' => TRUE,
+                       'sumy'       => TRUE,
+                       'te'         => TRUE,
+                       'ternopil'   => TRUE,
+                       'uz'         => TRUE,
+                       'uzhgorod'   => TRUE,
+                       'vinnica'    => TRUE,
+                       'vn'         => TRUE,
+                       'zaporizhzhe' => TRUE,
+                       'zhitomir'   => TRUE,
+                       'zp'         => TRUE,
+                       'zt'         => TRUE,
+               ),
+
+               // ccTLD: United Kingdom
+               // NIC  : http://www.nic.uk/
+               'uk' => array(
+                       // Second Level Domains
+                       // http://www.nic.uk/registrants/aboutdomainnames/sld/
+                       'co'     => TRUE,
+                       'ltd'    => TRUE,
+                       'me'     => TRUE,
+                       'net'    => TRUE,
+                       'nic'    => TRUE,
+                       'org'    => TRUE,
+                       'plc'    => TRUE,
+                       'sch'    => TRUE,
+                       
+                       // Delegated Second Level Domains
+                       // http://www.nic.uk/registrants/aboutdomainnames/sld/delegated/
+                       'ac'     => TRUE,
+                       'gov'    => TRUE,
+                       'mil'    => TRUE,
+                       'mod'    => TRUE,
+                       'nhs'    => TRUE,
+                       'police' => TRUE,
+               ),
+
+               // ccTLD: United States of America
+               // NIC  : http://nic.us/
+               // Whois: http://whois.us/
+               'us' => array(
+                       // RFC1480
+
+                       // United States Postal Service: State abbreviations (for postal codes)
+                       // http://www.usps.com/ncsc/lookups/abbreviations.html
+                       'ak' => TRUE, // Alaska
+                       'al' => TRUE, // Alabama
+                       'ar' => TRUE, // Arkansas
+                       'as' => TRUE, // American samoa
+                       'az' => TRUE, // Arizona
+                       'ca' => TRUE, // California
+                       'co' => TRUE, // Colorado
+                       'ct' => TRUE, // Connecticut
+                       'dc' => TRUE, // District of Columbia
+                       'de' => TRUE, // Delaware
+                       'fl' => TRUE, // Florida
+                       'fm' => TRUE, // Federated states of Micronesia
+                       'ga' => TRUE, // Georgia
+                       'gu' => TRUE, // Guam
+                       'hi' => TRUE, // Hawaii
+                       'ia' => TRUE, // Iowa
+                       'id' => TRUE, // Idaho
+                       'il' => TRUE, // Illinois
+                       'in' => TRUE, // Indiana
+                       'ks' => TRUE, // Kansas
+                       'ky' => TRUE, // Kentucky
+                       'la' => TRUE, // Louisiana
+                       'ma' => TRUE, // Massachusetts
+                       'md' => TRUE, // Maryland
+                       'me' => TRUE, // Maine
+                       'mh' => TRUE, // Marshall Islands
+                       'mi' => TRUE, // Michigan
+                       'mn' => TRUE, // Minnesota
+                       'mo' => TRUE, // Missouri
+                       'mp' => TRUE, // Northern mariana islands
+                       'ms' => TRUE, // Mississippi
+                       'mt' => TRUE, // Montana
+                       'nc' => TRUE, // North Carolina
+                       'nd' => TRUE, // North Dakota
+                       'ne' => TRUE, // Nebraska
+                       'nh' => TRUE, // New Hampshire
+                       'nj' => TRUE, // New Jersey
+                       'nm' => TRUE, // New Mexico
+                       'nv' => TRUE, // Nevada
+                       'ny' => TRUE, // New York
+                       'oh' => TRUE, // Ohio
+                       'ok' => TRUE, // Oklahoma
+                       'or' => TRUE, // Oregon
+                       'pa' => TRUE, // Pennsylvania
+                       'pr' => TRUE, // Puerto Rico
+                       'pw' => TRUE, // Palau
+                       'ri' => TRUE, // Rhode Island
+                       'sc' => TRUE, // South Carolina
+                       'sd' => TRUE, // South Dakota
+                       'tn' => TRUE, // Tennessee
+                       'tx' => TRUE, // Texas
+                       'ut' => TRUE, // Utah
+                       'va' => TRUE, // Virginia
+                       'vi' => TRUE, // Virgin Islands
+                       'vt' => TRUE, // Vermont
+                       'wa' => TRUE, // Washington
+                       'wi' => TRUE, // Wisconsin
+                       'wv' => TRUE, // West Virginia
+                       'wy' => TRUE, // Wyoming
+
+                       // Others
+                       'dni',
+                       'fed',
+                       'isa',
+                       'kids',
+                       'nsn',
+               ),
+       );
+
+       if (! is_string($fqdn)) return '';
+
+       $result  = array();
+       $dcursor = & $domain;
+       $array   = array_reverse(explode('.', $fqdn));
+       $i = 0;
+       while(TRUE) {
+               $acursor = $array[$i];
+               if (is_array($dcursor) && isset($dcursor[$acursor])) {
+                       $result[] = & $array[$i];
+                       $dcursor  = & $dcursor[$acursor];
                } else {
-                       foreach(array_keys($array[$key]) as $_key) {
-                               $joinkey = $reversejoin ?
-                                       $_key . $delim . $key :
-                                       $key  . $delim . $_key;
-                               $result[$joinkey] = & $array[$key][$_key];
+                       if (isset($acursor)) {
+                               $result[] = & $array[$i];       // Whois servers must know this subdomain
                        }
+                       break;
                }
+               ++$i;
        }
 
-       $array = & $result;
+       // Implicit responsibility: Top-Level-Domains must not be yours
+       // 'bar.foo.something' => 'foo.something'
+       if ($implicit && count($result) == 1 && count($array) > 1) {
+               $result[] = & $array[1];
+       }
 
-       return $result; // array('A.B' => 'C.D')
+       return $result ? implode('.', array_reverse($result)) : '';
 }
 
 
 // ---------------------
 // Exit
 
+// Freeing memories
+function spam_dispose()
+{
+       get_blocklist(NULL);
+}
+
 // Common bahavior for blocking
 // NOTE: Call this function from various blocking feature, to disgueise the reason 'why blocked'
 function spam_exit($mode = '', $data = array())
 {
-       // Dispose
-       get_blocklist(NULL);
 
        $exit = TRUE;
        switch ($mode) {
@@ -1587,11 +2096,11 @@ function pkwk_spamfilter($action, $page, $target = array('title' => ''), $method
 {
        $progress = check_uri_spam($target, $method);
 
-       if (! empty($progress['is_spam'])) {
-               // Mail to administrator(s)
+       if (empty($progress['is_spam'])) {
+               spam_dispose();
+       } else {
+               $target = string($target, 0);   // Removing "\0" etc
                pkwk_spamnotify($action, $page, $target, $progress, $method);
-
-               // Exit
                spam_exit($exitmode, $progress);
        }
 }