Changeset 791560
- Timestamp:
- 10/21/2013 11:47:01 PM (11 years ago)
- Location:
- mollom/trunk
- Files:
-
- 1 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
mollom/trunk/includes/Admin.php
r744135 r791560 78 78 )); 79 79 // Protection options section. 80 add_settings_field('mollom_unsure', __('When text analysisis 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( 81 81 'type' => 'radios', 82 82 'name' => 'mollom_unsure', 83 83 'options' => array( 84 'captcha' => __('Show a CAPTCHA ', MOLLOM_L10N),84 'captcha' => __('Show a CAPTCHA', MOLLOM_L10N), 85 85 'binary' => __('Accept the post', MOLLOM_L10N), 86 86 ), 87 87 'value' => get_option('mollom_unsure', 'captcha'), 88 89 90 91 88 92 )); 89 93 add_settings_field('mollom_bypass_roles', __('Bypass roles', MOLLOM_L10N), array('MollomForm', 'printItemsArray'), 'mollom', 'mollom_options', array( … … 103 107 'value' => get_option('mollom_fallback_mode', 'accept'), 104 108 '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/', 107 111 )), 108 112 )); … … 111 115 'name' => 'mollom_privacy_link', 112 116 'label' => __("Link to Mollom's privacy policy", MOLLOM_L10N), 113 'value' => get_option('mollom_privacy_link' ),117 'value' => get_option('mollom_privacy_link'), 114 118 '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', 117 121 )), 118 122 )); … … 131 135 'label' => __('Enable Mollom testing mode', MOLLOM_L10N), 132 136 'value' => get_option('mollom_testing_mode'), 133 // @todo Sanitize.134 137 '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), 135 138 )); -
mollom/trunk/includes/Entity.php
r744135 r791560 81 81 * @see MollomEntity::alterFormAction() 82 82 */ 83 public function buildForm( ) {83 public function buildForm() { 84 84 if ($this->isPrivileged()) { 85 85 return ''; … … 95 95 $output .= MollomForm::formatInput('hidden', 'mollom[captchaId]', $values['captchaId']); 96 96 97 $output .= '<div class="hidden">';97 $output .= '<div ">'; 98 98 $output .= MollomForm::formatInput('text', 'mollom[homepage]', $values['homepage']); 99 99 $output .= '</div>'; … … 117 117 118 118 $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 )); 120 122 } 121 123 122 124 if (get_option('mollom_privacy_link', TRUE)) { 123 125 $output .= "\n"; 124 $output .= '<p class="description">'; 126 $output .= '<p class="description mollom-privacy-policy">'; 127 $output .= '<small>'; 125 128 $output .= vsprintf(__('By submitting this form, you accept the <a href="%s" target="_blank" rel="nofollow">Mollom privacy policy</a>.', MOLLOM_L10N), array( 126 129 'https://mollom.com/web-service-privacy-policy', 127 130 )); 131 128 132 $output .= '</p>'; 129 133 } … … 173 177 $data = MollomForm::unescapeUserInput($data); 174 178 175 $data ['authorIp'] = self::getAuthorIp();179 $data(); 176 180 177 181 if (isset($_POST['mollom']['homepage']) && $_POST['mollom']['homepage'] !== '') { … … 179 183 } 180 184 181 $author_data = array_intersect_key($data, array_flip(array('author Name', 'authorMail', 'authorUrl', 'authorIp', 'authorId', 'honeypot')));185 $author_data = array_intersect_key($data, array_flip(array('author', 'honeypot'))); 182 186 183 187 // Check (unsure) CAPTCHA solution. … … 403 407 'stored' => 1, 404 408 ); 409 410 411 412 405 413 mollom()->checkContent($data); 406 414 // Save meta data. … … 490 498 491 499 /** 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 492 531 * Returns the IP address of the client. 493 532 * -
mollom/trunk/includes/EntityComment.php
r744135 r791560 44 44 */ 45 45 public function buildForm($fields) { 46 $fields['comment_notes_after'] .= parent::buildForm( );46 $fields['comment_notes_after'] .= parent::buildForm(); 47 47 return $fields; 48 48 } -
mollom/trunk/includes/Moderation.php
r737526 r791560 33 33 self::$contentId = $contentId; 34 34 self::$action = $action; 35 36 37 35 38 // Verify the action. 36 39 if (!in_array($action, array('approve', 'spam', 'delete'))) { 37 40 header($_SERVER['SERVER_PROTOCOL'] . ' 400 Bad Request'); 41 42 43 38 44 return FALSE; 39 45 } … … 46 52 return FALSE; 47 53 } 54 55 56 48 57 // Validate OAuth Authorization header. 49 58 if (!self::validateAuth()) { 50 59 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); 55 68 } 56 69 -
mollom/trunk/mollom.php
r744135 r791560 4 4 Plugin Name: Mollom 5 5 Plugin URI: https://mollom.com 6 Version: 2. 16 Version: 2. 7 7 Text Domain: mollom 8 8 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>. … … 55 55 // Note the priority argument semantics (4th argument to add_filter/add_action): 56 56 // WordPress $priority == Drupal $weight != Symfony $priority 57 57 58 add_action('plugins_loaded', 'mollom_plugins_loaded'); 58 59 add_action('init', 'mollom_moderate'); … … 65 66 } 66 67 68 67 69 add_filter('comment_form_defaults', 'mollom_dispatch_hook'); 68 70 add_filter('preprocess_comment', 'mollom_dispatch_hook', 0); … … 71 73 add_action('wp_set_comment_status', 'mollom_dispatch_hook', 10, 2); 72 74 add_action('transition_comment_status', 'mollom_dispatch_hook', 10, 3); 73 add_action('mollom_moderate_comment', 'mollom_dispatch_hook', 10, 2); 75 add_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 80 add_action('register_form', 'mollom_dispatch_hook'); 81 add_filter('registration_errors', 'mollom_dispatch_hook', 10, 3); 82 // @see wp_create_user(), wp_insert_user(), wp-includes/user.php 83 add_action('user_register', 'mollom_dispatch_hook'); 84 // @see wp_delete_user(), wp-admin/includes/user.php 85 add_action('delete_user', 'mollom_dispatch_hook'); 86 add_filter('mollom_moderate_user', 'mollom_dispatch_hook', 10, 2); 74 87 75 88 add_filter('wp_die_handler', 'mollom_die_handler_callback', 100); … … 100 113 static $instances = array(); 101 114 static $mapping = array( 115 102 116 'comment_form_defaults' => array('MollomEntityComment', 'buildForm'), 103 117 'preprocess_comment' => array('MollomEntityComment', 'validateForm'), … … 107 121 'transition_comment_status' => array('MollomEntityComment', 'transitionStatus'), 108 122 'mollom_moderate_comment' => array('MollomEntityComment', 'moderate'), 123 124 125 126 127 128 109 129 ); 110 130 … … 179 199 if (preg_match('@/mollom/moderate/(?P<contentId>[^/]+)/(?P<action>[^/]+)$@', $_SERVER['REQUEST_URI'], $args)) { 180 200 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'); 182 202 exit; 183 203 } -
mollom/trunk/readme.txt
r744135 r791560 4 4 Tags: comments, spam, social, content, moderation, captcha, mollom 5 5 Requires at least: 3.1.0 6 Tested up to: 3. 5.17 Stable tag: 2. 16 Tested up to: 3. 7 Stable tag: 2. 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 130 130 131 131 132 133 134 135 136 137 138 139 140 132 141 == Upgrade Notice == 133 142 … … 138 147 == Changelog == 139 148 149 150 151 152 153 154 140 155 = 2.1 = 156 141 157 142 158 * Fixed comment reply form is not positioned below parent comment when form is re-rendered. … … 146 162 147 163 = 2.0 = 164 148 165 149 166 * Rewritten and re-architected for Mollom's new [REST API](http://mollom.com/api). 150 167 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.