Skip to content

Commit

Permalink
Various minor bugfixes.
Browse files Browse the repository at this point in the history
Added a few TODOs and FIXMEs
  • Loading branch information
stephen.r.rider@gmail.com committed Jan 16, 2015
1 parent 3494fb3 commit 300f9f4
Show file tree
Hide file tree
Showing 10 changed files with 302 additions and 300 deletions.
562 changes: 281 additions & 281 deletions spam-karma/license.txt

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion spam-karma/sk_about.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"Peter Westwood" => "http://blog.ftwr.co.uk/",
"Owen Winkler" => "http://www.asymptomatic.net/",
"Jason" => "http://ushimitsudoki.com/",
"Drac" => "http://fierydragon.org",
"Drac" => "http://fierydragon.org/",
'Alexander Concha' => 'http://www.buayacorp.com/',
'priv' => 'http://privism.org/blog/',
'Priit Laes' => 'http://plaes.org/'
Expand Down
2 changes: 1 addition & 1 deletion spam-karma/sk_comment_class.php
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ function parse_URIs ($str = "")

$this->content_filtered = $raw_text . substr($str, $cur_pos);
}


function extract_domain($str)
{
Expand Down
6 changes: 3 additions & 3 deletions spam-karma/sk_core_class.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,8 @@ function form_insert ($post_ID = 0)
if ($plugin[1]->is_enabled())
$plugin[1]->form_insert($post_ID);
}


function second_chance()
{
if (! $this->cur_comment)
Expand Down Expand Up @@ -306,7 +306,7 @@ function second_chance()
$this->set_comment_sk_info();
}


// TODO: maybe change default priority to 10 just for consistency with WP hook priority norms.
function register_plugin($plugin_class, $priority = 5)
{
$i = 0;
Expand Down
2 changes: 1 addition & 1 deletion spam-karma/sk_plugins/sk_captcha_plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ function treat_second_chance(&$cmt_object, $unlock_key)
}
}

function output_plugin_UI()
function output_plugin_UI($output_dls = true)
{
echo "<dl>";
parent::output_plugin_UI(false); // call default constructor
Expand Down
2 changes: 1 addition & 1 deletion spam-karma/sk_plugins/sk_pjw_daily_digest_plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ function treat_this(&$cmt_object)
}

//Overrides
function output_plugin_UI()
function output_plugin_UI($output_dls = true)
{
echo "<dl>";
parent::output_plugin_UI(false);
Expand Down
16 changes: 8 additions & 8 deletions spam-karma/sk_plugins/sk_rbl_plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,13 @@ class sk_rbl_plugin extends sk_plugin
Looks up host in RBL
Returns the returned RBL host if found, else the empty string
*/
function rbl_lookup($rbl_host)
{
if (empty($rbl_host)) {
return '';
}

function rbl_lookup($rbl_host)
{
if (empty($rbl_host)) {
return '';
}

// TODO see next note. WP requires PHP 5, so we can switch to dns_get_record?
/* gethostbyname() seems to hate hostnames with "/" in
if we have a "/" in the host, look it up this way
instead which works but doesn't give us the returned data.
Expand Down Expand Up @@ -119,7 +120,6 @@ function rbl_lookup($rbl_host)
}
}


function filter_this(&$cmt_object)
{
global $sk_blacklist;
Expand Down Expand Up @@ -224,7 +224,7 @@ function update_SQL_schema($cur_version)
return true;
}

function treat_this($cmt_object)
function treat_this(&$cmt_object)
{
if ($this->get_option_value('do_submit') != "on") {
return;
Expand Down
2 changes: 1 addition & 1 deletion spam-karma/sk_plugins/sk_referrer_check_plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ function filter_this(&$cmt_object)
}
}

function output_plugin_UI()
function output_plugin_UI($output_dls = true)
{
echo "<dl>";
parent::output_plugin_UI(false); // call default constructor
Expand Down
4 changes: 2 additions & 2 deletions spam-karma/sk_plugins/sk_snowball_plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ class sk_snowball_plugin extends sk_plugin
var $retro_spanked = false;

var $settings_format = array (
'old_enough' => array('type' => 'text', 'value'=> 3, 'caption' => 'On an average you check new comments every', 'size' => 2, after => 'days.'),
'threshold' => array('type' => 'text', 'value'=> 2, 'caption' => 'Trigger when somebody posts more than', 'size' => 5, after => 'comments over the above time-period.'),
'old_enough' => array('type' => 'text', 'value'=> 3, 'caption' => 'On an average you check new comments every', 'size' => 2, 'after' => 'days.'),
'threshold' => array('type' => 'text', 'value'=> 2, 'caption' => 'Trigger when somebody posts more than', 'size' => 5, 'after' => 'comments over the above time-period.'),
'coef' => array('advanced' => true, 'type' => 'text', 'value'=> 3, 'caption' => 'Old comments/new comments coefficient: ', 'size' => 3),
'good_karma' => array('advanced' => true, 'type' => 'text', 'value'=> 5, 'caption' => 'Good/bad karma average: ', 'size' => 3)
);
Expand Down
4 changes: 3 additions & 1 deletion spam-karma/sk_tld_list.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<?php

// Last updated ???
// This should be sourced from the list maintained by Mozilla at http://publicsuffix.org/
// FIXME: TLD list is grossly outdated. Should have source that gets updated --
// maybe the list maintained by Mozilla at http://publicsuffix.org/
// probably easiest to actively match complex TLDs only and otherwise assume last post-dot string is TLD.

$complex_tlds = array (
'ac',
Expand Down

0 comments on commit 300f9f4

Please sign in to comment.