<?php
-// $Id: spam_pickup.php,v 1.39 2007/02/17 13:43:59 henoheno Exp $
+// $Id: spam_pickup.php,v 1.43 2007/03/25 13:46:43 henoheno Exp $
// Concept-work of spam-uri metrics
// Copyright (C) 2006-2007 PukiWiki Developers Team
// License: GPL v2 or (at your option) any later version
echo show_form($msg, $asap, $prog, $pickup);
echo '<br/>';
-echo '<pre>';
-
// -----------------------------------------------------
$spam = array();
if ($asap) $method['asap'] = TRUE;
-$progress = check_uri_spam(array('a', $msg, 'b'), $method);
+$progress = check_uri_spam(
+ array(
+ 'a http://foobaA.example.com',
+ $msg,
+ 'b http://foobarB.example.com'
+ ), $method);
if (! empty($progress)) {
if (empty($progress['is_spam'])) {
- var_dump('ACTION: Seems not a spam');
+ echo 'ACTION: Seems not a spam';
+ echo '<br />';
} else {
- var_dump('ACTION: Blocked by ' . summarize_spam_progress($progress, TRUE));
+ echo 'ACTION: Blocked by ' . summarize_spam_progress($progress, TRUE);
+ echo '<br />';
- if (! $asap) var_dump('METRICS: ' . summarize_spam_progress($progress));
+ if (! $asap) {
+ echo 'METRICS: ' . summarize_spam_progress($progress);
+ echo '<br />';
+ }
$action = 'Blocked by: ' . summarize_spam_progress($progress, TRUE);
if (isset($progress['is_spam']['badhost'])) {
foreach($progress['is_spam']['badhost'] as $glob=>$number) {
$badhost[] = $glob . '(' . $number . ')';
}
- var_dump('DETAIL_BADHOST: ' . implode(', ', $badhost));
- //var_dump($progress['is_spam']['badhost']);
+ echo 'DETAIL_BADHOST: ' . htmlspecialchars(implode(', ', $badhost));
+ echo '<br />';
}
}
if (isset($progress['remains']['badhost'])) {
$count = count($progress['remains']['badhost']);
- var_dump('DETAIL_NEUTRAL_HOST: ' . $count .
+ echo 'DETAIL_NEUTRAL_HOST: ' . $count .
' (' .
- preg_replace(
- '/[^, a-z0-9.-]/i', '',
- implode(', ', array_keys($progress['remains']['badhost']))
+ htmlspecialchars(
+ preg_replace(
+ '/[^, a-z0-9.-]/i',
+ '',
+ implode(', ', array_keys($progress['remains']['badhost']))
+ )
) .
- ')'
- );
+ ')';
+ echo '<br />';
}
- if ($prog) var_dump($progress);
+ if ($prog) {
+ echo '<pre>';
+ htmlspecialchars(var_dump($progress));
+ echo '</pre>';
+ }
}
if ($pickup) {
- $results = spam_uri_pickup($msg);
- $results = uri_array_normalize($results, TRUE);
- var_dump('$results', $results);
+ echo '<pre>';
+ $results = uri_pickup_normalize(spam_uri_pickup($msg));
+ htmlspecialchars(var_dump('$results', $results));
+ echo '</pre>';
}
-
-echo '</pre>';
-
?>