Plugin Directory

Changeset 1106596


Ignore:
Timestamp:
03/06/2015 05:52:19 AM (11 years ago)
Author:
ohtan
Message:

up to 2.2.0

Location:
spam-byebye
Files:
8 added
5 edited

Legend:

Unmodified
Added
Removed
  • spam-byebye/trunk/config.default.php

    r1097942 r1106596  
    2626// 複数指定する場合は「,」で区切る
    2727define('SB2_URIBL_HOSTS', 'url.rbl.jp,dyndns.rbl.jp,notop.rbl.jp,multi.surbl.org,multi.uribl.com');
     28
     29// ホワイトリスト(メールアドレス)
     30// 複数指定する場合は「,」で区切る
     31define('SB2_WHITE_LISTS', '');
    2832
    2933/************************************************** チェック項目設定 ***************************************************
  • spam-byebye/trunk/readme.txt

    r1097942 r1106596  
    44Requires at least: 3.0.0
    55Tested up to: 4.1.1
    6 Stable tag: 2.1.3
     6Stable tag: 2.2.0
    77License: GPLv2
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    7777* 複数のブラックリストデータベースを指定する場合は1件毎に改行を入れてください
    7878
     79####7.ホワイトリスト(メールアドレス)
     80* このリストのメールアドレスとEmail欄のメールドレスが一致した場合は検査を行いません
     81* 複数のメールアドレスを指定する場合は1件毎に改行を入れてください
     82
    7983### チェック項目設定
    8084####1.優先度
     
    234238
    235239== Changelog ==
     240= 2.2.0 =
     241* ホワイトリスト機能を追加
     242
    236243= 2.1.3 =
    237244* DNSBLの初期設定からスパムちゃんぷるーを削除
  • spam-byebye/trunk/setup.php

    r632978 r1106596  
    7878        </tr>
    7979        <tr style="background-color:#ececec;">
    80             <th rowspan="2" style="border-right:1px solid #dfdfdf;border-bottom:0;">URIBLデータベース</th>
     80            <th rowspan="2" style="border-right:1px solid #dfdfdf;">URIBLデータベース</th>
    8181            <td style="border-bottom:0;"><textarea name="SB2_URIBL_HOSTS[]" rows="5" cols="70" class="search-input"><?php echo htmlspecialchars($_POST['SB2_URIBL_HOSTS'][0]); ?></textarea></td>
    8282        </tr>
    8383        <tr style="background-color:#ececec;">
    84             <td style="color:red;border-top:0;border-bottom:0;"><?php echo $_POST['SB2_URIBL_HOSTS']['error']; ?></td>
     84            <td style="color:red;border-top:0;"><?php echo $_POST['SB2_URIBL_HOSTS']['error']; ?></td>
     85        </tr>
     86        <tr style="background-color:#f9f9f9;">
     87            <th rowspan="2" style="border-right:1px solid #dfdfdf;border-bottom:0;">ホワイトリスト<br />(メールアドレス)</th>
     88            <td style="border-bottom:0;"><textarea name="SB2_WHITE_LISTS[]" rows="5" cols="70" class="search-input"><?php echo htmlspecialchars($_POST['SB2_WHITE_LISTS'][0]); ?></textarea></td>
     89        </tr>
     90        <tr style="background-color:#f9f9f9;">
     91            <td style="color:red;border-top:0;border-bottom:0;"><?php echo $_POST['SB2_WHITE_LISTS']['error']; ?></td>
    8592        </tr>
    8693        </tbody>
  • spam-byebye/trunk/spam-bye2.php

    r1097942 r1106596  
    55Description: コメントスパム対策用プラグイン
    66Author: ohtan
    7 Version: 2.1.3
     7Version: 2.2.0
    88Author URI: http://cmf.ohtanz.com/
    99License: GPL2
     
    4444            $inData['comment_author'],
    4545            $inData['comment_author_url'],
    46             $inData['comment_content']
     46            $inData['comment_content'],
     47            $inData['comment_author_email']
    4748        );
    4849    }
     
    118119                        case preg_match("/^SB2_DNSBL_HOSTS$/", $key):
    119120                        case preg_match("/^SB2_URIBL_HOSTS$/", $key):
     121                        case preg_match("/^SB2_WHITE_LISTS$/", $key):
    120122                            $line .= "define('${key}', '" . $this->sb2SetupSreplace($val[0]) . "');\n";
    121123                            break;
     
    187189            }
    188190        }
     191        foreach (preg_split("/[\s]+/", $_POST['SB2_WHITE_LISTS'][0]) as $val) {
     192            if ($val !== "" && !preg_match("/^[0-9A-Za-z._\-]+@[0-9A-Za-z.\-]+$/i", $val)) {
     193                $_POST['SB2_WHITE_LISTS']['error'] = "値を正しく入力してください";
     194                $this->error = 1;
     195                break;
     196            }
     197        }
    189198
    190199        foreach ($_POST as $key=>$val) {
     
    296305        $_POST['SB2_DNSBL_HOSTS'][0] = str_replace(",", "\r", SB2_DNSBL_HOSTS);
    297306        $_POST['SB2_URIBL_HOSTS'][0] = str_replace(",", "\r", SB2_URIBL_HOSTS);
     307        $_POST['SB2_WHITE_LISTS'][0] = (defined('SB2_WHITE_LISTS') ? str_replace(",", "\r", SB2_WHITE_LISTS) : null);
    298308        $_POST['SB2_ENTRY_OBJECT'][0] = SB2_ENTRY_OBJECT;
    299309
     
    328338    var $sb2Badpoint = 0;
    329339
    330     function spamBye2Check($author,$url,$content)
    331     {
     340    function spamBye2Check($author, $url, $content, $email)
     341    {
     342        (array)$white_list = $this->sb2Explode(SB2_WHITE_LISTS, ',');
     343        if (in_array($email, $white_list)) return;
     344
    332345        if (!function_exists("mb_convert_encoding") || !function_exists("mb_strlen") || !function_exists("mb_detect_encoding")) {
    333346            wp_die('mbstring function is not found');
Note: See TracChangeset for help on using the changeset viewer.