Plugin Directory

Changeset 791560

Timestamp:
10/21/2013 11:47:01 PM (11 years ago)
Author:
tha_sun
Message:

Preparing release 2.2.

Location:
mollom/trunk
Files:
1 added
6 edited

Legend:

Unmodified
Added
Removed
  • mollom/trunk/includes/Admin.php

    r744135 r791560  
    7878    ));
    7979    // Protection options section.
    80     add_settings_field('mollom_unsure', __('When text analysis is unsure', MOLLOM_L10N), array('MollomForm', 'printItemsArray'), 'mollom', 'mollom_options', array(
     80    add_settings_field('mollom_unsure', __('When is unsure', MOLLOM_L10N), array('MollomForm', 'printItemsArray'), 'mollom', 'mollom_options', array(
    8181      'type' => 'radios',
    8282      'name' => 'mollom_unsure',
    8383      'options' => array(
    84         'captcha' => __('Show a CAPTCHA', MOLLOM_L10N),
     84        'captcha' => __('Show a CAPTCHA', MOLLOM_L10N),
    8585        'binary' => __('Accept the post', MOLLOM_L10N),
    8686      ),
    8787      'value' => get_option('mollom_unsure', 'captcha'),
     88
     89
     90
     91
    8892    ));
    8993    add_settings_field('mollom_bypass_roles', __('Bypass roles', MOLLOM_L10N), array('MollomForm', 'printItemsArray'), 'mollom', 'mollom_options', array(
     
    103107      'value' => get_option('mollom_fallback_mode', 'accept'),
    104108      'description' => vsprintf(__('In case Mollom services are unreachable, no text analysis can be performed and no CAPTCHAs can be generated. Customers on <a href="%s">paid plans</a> have access to <a href="%s">Mollom\'s high-availability backend infrastructure</a>, not available to free users, reducing potential downtime.', MOLLOM_L10N), array(
    105         'https://mollom.com/web-service-privacy-policy',
    106         'https://mollom.com/terms-of-service',
     109        'https://mollom.com/',
     110        'https://mollom.com/',
    107111      )),
    108112    ));
     
    111115      'name' => 'mollom_privacy_link',
    112116      'label' => __("Link to Mollom's privacy policy", MOLLOM_L10N),
    113       'value' => get_option('mollom_privacy_link'),
     117      'value' => get_option('mollom_privacy_link'),
    114118      'description' => vsprintf(__('Displays a link to the recommended <a href="%s">privacy policy on mollom.com</a> on all protected forms. When disabling this option, you are required to inform visitors about data privacy through other means, as stated in the <a href="%s">terms of service</a>.', MOLLOM_L10N), array(
    115         '@privacy-policy-url' => 'https://mollom.com/web-service-privacy-policy',
    116         '@terms-of-service-url' => 'https://mollom.com/terms-of-service',
     119        'https://mollom.com/web-service-privacy-policy',
     120        'https://mollom.com/terms-of-service',
    117121      )),
    118122    ));
     
    131135      'label' => __('Enable Mollom testing mode', MOLLOM_L10N),
    132136      'value' => get_option('mollom_testing_mode'),
    133       // @todo Sanitize.
    134137      'description' => __('Submitting "ham", "unsure", or "spam" on a protected form will trigger the corresponding behavior. Image CAPTCHAs will only respond to "correct" and audio CAPTCHAs only respond to "demo". This option should be disabled in production environments.', MOLLOM_L10N),
    135138    ));
  • mollom/trunk/includes/Entity.php

    r744135 r791560  
    8181   * @see MollomEntity::alterFormAction()
    8282   */
    83   public function buildForm() {
     83  public function buildForm() {
    8484    if ($this->isPrivileged()) {
    8585      return '';
     
    9595    $output .= MollomForm::formatInput('hidden', 'mollom[captchaId]', $values['captchaId']);
    9696
    97     $output .= '<div class="hidden">';
     97    $output .= '<div ">';
    9898    $output .= MollomForm::formatInput('text', 'mollom[homepage]', $values['homepage']);
    9999    $output .= '</div>';
     
    117117
    118118      $output .= "\n";
    119       $output .= MollomForm::formatItem('text', __('Word verification', MOLLOM_L10N), $captcha);
     119      $output .= MollomForm::formatItem('text', __('Word verification', MOLLOM_L10N), $captcha, __('Type the characters in the image above (not case-sensitive).', MOLLOM_L10N), array(
     120        'item' => array('class' => array('mollom-captcha'))
     121      ));
    120122    }
    121123
    122124    if (get_option('mollom_privacy_link', TRUE)) {
    123125      $output .= "\n";
    124       $output .= '<p class="description">';
     126      $output .= '<p class="description mollom-privacy-policy">';
     127      $output .= '<small>';
    125128      $output .= vsprintf(__('By submitting this form, you accept the <a href="%s" target="_blank" rel="nofollow">Mollom privacy policy</a>.', MOLLOM_L10N), array(
    126129        'https://mollom.com/web-service-privacy-policy',
    127130      ));
     131
    128132      $output .= '</p>';
    129133    }
     
    173177    $data = MollomForm::unescapeUserInput($data);
    174178
    175     $data['authorIp'] = self::getAuthorIp();
     179    $data();
    176180
    177181    if (isset($_POST['mollom']['homepage']) && $_POST['mollom']['homepage'] !== '') {
     
    179183    }
    180184
    181     $author_data = array_intersect_key($data, array_flip(array('authorName', 'authorMail', 'authorUrl', 'authorIp', 'authorId', 'honeypot')));
     185    $author_data = array_intersect_key($data, array_flip(array('author', 'honeypot')));
    182186
    183187    // Check (unsure) CAPTCHA solution.
     
    403407      'stored' => 1,
    404408    );
     409
     410
     411
     412
    405413    mollom()->checkContent($data);
    406414    // Save meta data.
     
    490498
    491499  /**
     500
     501
     502
     503
     504
     505
     506
     507
     508
     509
     510
     511
     512
     513
     514
     515
     516
     517
     518
     519
     520
     521
     522
     523
     524
     525
     526
     527
     528
     529
     530
    492531   * Returns the IP address of the client.
    493532   *
  • mollom/trunk/includes/EntityComment.php

    r744135 r791560  
    4444   */
    4545  public function buildForm($fields) {
    46     $fields['comment_notes_after'] .= parent::buildForm();
     46    $fields['comment_notes_after'] .= parent::buildForm();
    4747    return $fields;
    4848  }
  • mollom/trunk/includes/Moderation.php

    r737526 r791560  
    3333    self::$contentId = $contentId;
    3434    self::$action = $action;
     35
     36
     37
    3538    // Verify the action.
    3639    if (!in_array($action, array('approve', 'spam', 'delete'))) {
    3740      header($_SERVER['SERVER_PROTOCOL'] . ' 400 Bad Request');
     41
     42
     43
    3844      return FALSE;
    3945    }
     
    4652      return FALSE;
    4753    }
     54
     55
     56
    4857    // Validate OAuth Authorization header.
    4958    if (!self::validateAuth()) {
    5059      header($_SERVER['SERVER_PROTOCOL'] . ' 401 Unauthorized');
    51       return FALSE;
    52     }
    53     do_action('mollom_moderate_' . self::$entityType, self::$entityId, $action);
    54     return TRUE;
     60      self::log(array(
     61        'message' => 'Invalid authentication',
     62      ));
     63      return FALSE;
     64    }
     65    // The actual moderation callback is part of the filter chain and returns
     66    // TRUE on success, FALSE on failure.
     67    return apply_filters('mollom_moderate_' . self::$entityType, self::$entityId, $action);
    5568  }
    5669
  • mollom/trunk/mollom.php

    r744135 r791560  
    44  Plugin Name: Mollom
    55  Plugin URI: https://mollom.com
    6   Version: 2.1
     6  Version: 2.
    77  Text Domain: mollom
    88  Description: Protects you from spam and unwanted posts. <strong>Get started:</strong> 1) <em>Activate</em>, 2) <a href="https://mollom.com/pricing">Sign up</a> and create API keys, 3) Set them in <a href="options-general.php?page=mollom">settings</a>.
     
    5555// Note the priority argument semantics (4th argument to add_filter/add_action):
    5656//   WordPress $priority == Drupal $weight != Symfony $priority
     57
    5758add_action('plugins_loaded', 'mollom_plugins_loaded');
    5859add_action('init', 'mollom_moderate');
     
    6566}
    6667
     68
    6769add_filter('comment_form_defaults', 'mollom_dispatch_hook');
    6870add_filter('preprocess_comment', 'mollom_dispatch_hook', 0);
     
    7173add_action('wp_set_comment_status', 'mollom_dispatch_hook', 10, 2);
    7274add_action('transition_comment_status', 'mollom_dispatch_hook', 10, 3);
    73 add_action('mollom_moderate_comment', 'mollom_dispatch_hook', 10, 2);
     75add_filter('mollom_moderate_comment', 'mollom_dispatch_hook', 10, 2);
     76
     77// Users.
     78// @todo Multisite uses wp-signup.php.
     79// @see register_new_user(), wp-login.php
     80add_action('register_form', 'mollom_dispatch_hook');
     81add_filter('registration_errors', 'mollom_dispatch_hook', 10, 3);
     82// @see wp_create_user(), wp_insert_user(), wp-includes/user.php
     83add_action('user_register', 'mollom_dispatch_hook');
     84// @see wp_delete_user(), wp-admin/includes/user.php
     85add_action('delete_user', 'mollom_dispatch_hook');
     86add_filter('mollom_moderate_user', 'mollom_dispatch_hook', 10, 2);
    7487
    7588add_filter('wp_die_handler', 'mollom_die_handler_callback', 100);
     
    100113  static $instances = array();
    101114  static $mapping = array(
     115
    102116    'comment_form_defaults' => array('MollomEntityComment', 'buildForm'),
    103117    'preprocess_comment' => array('MollomEntityComment', 'validateForm'),
     
    107121    'transition_comment_status' => array('MollomEntityComment', 'transitionStatus'),
    108122    'mollom_moderate_comment' => array('MollomEntityComment', 'moderate'),
     123
     124
     125
     126
     127
     128
    109129  );
    110130
     
    179199  if (preg_match('@/mollom/moderate/(?P<contentId>[^/]+)/(?P<action>[^/]+)$@', $_SERVER['REQUEST_URI'], $args)) {
    180200    echo (int) MollomModeration::handleRequest($args['contentId'], $args['action']);
    181     //error_log(var_export(MollomModeration::$log, TRUE), 3, __DIR__ . '/includes/log.log');
     201    //error_log(var_export(MollomModeration::$log, TRUE), 3, __DIR__ . '/includes/log.log');
    182202    exit;
    183203  }
  • mollom/trunk/readme.txt

    r744135 r791560  
    44Tags: comments, spam, social, content, moderation, captcha, mollom
    55Requires at least: 3.1.0
    6 Tested up to: 3.5.1
    7 Stable tag: 2.1
     6Tested up to: 3.
     7Stable tag: 2.
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    130130
    131131
     132
     133
     134
     135
     136
     137
     138
     139
     140
    132141== Upgrade Notice ==
    133142
     
    138147== Changelog ==
    139148
     149
     150
     151
     152
     153
     154
    140155= 2.1 =
     156
    141157
    142158* Fixed comment reply form is not positioned below parent comment when form is re-rendered.
     
    146162
    147163= 2.0 =
     164
    148165
    149166* Rewritten and re-architected for Mollom's new [REST API](http://mollom.com/api).
    150167
     168
     169
     170
     171
     172
     173
     174
     175
     176
     177
     178
     179
     180
     181
     182
     183
     184
     185
     186
     187
     188
     189
     190
     191
     192
     193
     194
     195
     196
     197
     198
     199
     200
     201
     202
     203
     204
     205
     206
     207
     208
     209
     210
     211
     212
     213
     214
     215
     216
     217
     218
     219
     220
     221
     222
     223
     224
     225
     226
     227
     228
     229
     230
     231
     232
     233
     234
     235
     236
     237
     238
     239
     240
     241
     242
     243
     244
     245
     246
     247
     248
     249
     250
     251
     252
     253
     254
     255
     256
     257
     258
     259
     260
     261
     262
     263
     264
     265
     266
     267
     268
     269
Note: See TracChangeset for help on using the changeset viewer.