[phpmix-cvs] drupal/modules/akismet CHANGELOG.txt, 1.5, 1.6 INSTALL.txt, 1.4, 1.5 README.txt, 1.5,
Status: Pre-Alpha
Brought to you by:
markus_petrux
From: <php...@li...> - 2006-06-20 15:16:53
|
Update of /cvsroot/phpmix/drupal/modules/akismet In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9818 Modified Files: CHANGELOG.txt INSTALL.txt README.txt akismet.module Log Message: - Fixed bug: Do not apply anti-spambot checks if there have already been errors detected in the form. - Fixed bug: Do not check for empty body/mail in anti-spambot prevention code. - Added a function to expand the SQL query used to match spambots. This is hopefully better, for debuggin purposes. - Version changed to 1.1.2 and releasing... Index: CHANGELOG.txt =================================================================== RCS file: /cvsroot/phpmix/drupal/modules/akismet/CHANGELOG.txt,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** CHANGELOG.txt 20 Jun 2006 01:18:12 -0000 1.5 --- CHANGELOG.txt 20 Jun 2006 15:16:44 -0000 1.6 *************** *** 4,7 **** --- 4,19 ---- Akismet module in CVS ------------------------------------------------ + - No changes yet. + + + Akismet module v1.1.2 for Drupal 4.7, 2006-06-20 + ------------------------------------------------ + - Fixed bug: Do not apply anti-spambot checks if there have already + been errors detected in the form. + - Fixed bug: Do not check for empty body/mail in anti-spambot + prevention code. + - Added a function to expand the SQL query used to match spambots. + This is hopefully better, for debuggin purposes. + Akismet module v1.1.0 for Drupal 4.7, 2006-06-20 *************** *** 20,23 **** --- 32,36 ---- speed up some queries. Requires running http://site/update.php + Akismet module v1.0.0 for Drupal 4.7, 2006-06-12 ------------------------------------------------ Index: INSTALL.txt =================================================================== RCS file: /cvsroot/phpmix/drupal/modules/akismet/INSTALL.txt,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** INSTALL.txt 20 Jun 2006 01:13:54 -0000 1.4 --- INSTALL.txt 20 Jun 2006 15:16:44 -0000 1.5 *************** *** 4,8 **** ******************************************************************** Name : akismet ! Version : 1.1.0 Author : markus_petrux [ http://www.phpmix.org ] Drupal : 4.7 --- 4,8 ---- ******************************************************************** Name : akismet ! Version : 1.1.2 Author : markus_petrux [ http://www.phpmix.org ] Drupal : 4.7 *************** *** 13,17 **** * INSTALLATION ! * UPGRADING from 1.0.0 * UNINSTALLATION * OPTIONAL INSTALLATION STEP --- 13,18 ---- * INSTALLATION ! * UPGRADING from 1.1.0 to 1.1.2 ! * UPGRADING from 1.0.0 to 1.1.0 * UNINSTALLATION * OPTIONAL INSTALLATION STEP *************** *** 38,42 **** ******************************************************************** ! UPGRADING from 1.0.0: 1. Copy all new modules files, keeping directory structure, to the --- 39,53 ---- ******************************************************************** ! UPGRADING from 1.1.0 to 1.1.2: ! ! 1. Copy the file akismet.module to the folder 'modules/akismet'. ! No other changes have been made. Please consult the file ! CHANGELOG.txt for details. ! ! 2. You're done. ! ! ! ******************************************************************** ! UPGRADING from 1.0.0 to 1.1.0: 1. Copy all new modules files, keeping directory structure, to the Index: README.txt =================================================================== RCS file: /cvsroot/phpmix/drupal/modules/akismet/README.txt,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** README.txt 20 Jun 2006 01:13:54 -0000 1.5 --- README.txt 20 Jun 2006 15:16:44 -0000 1.6 *************** *** 4,8 **** ******************************************************************** Name : akismet ! Version : 1.1.0 Author : markus_petrux [ http://www.phpmix.org ] Drupal : 4.7 --- 4,8 ---- ******************************************************************** Name : akismet ! Version : 1.1.2 Author : markus_petrux [ http://www.phpmix.org ] Drupal : 4.7 Index: akismet.module =================================================================== RCS file: /cvsroot/phpmix/drupal/modules/akismet/akismet.module,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** akismet.module 20 Jun 2006 01:22:40 -0000 1.24 --- akismet.module 20 Jun 2006 15:16:44 -0000 1.25 *************** *** 6,10 **** */ define('AKISMET_DRUPAL_VERSION', '4.7'); ! define('AKISMET_MODULE_VERSION', '1.1.0'); define('AKISMET_MODULE_HOMEURL', 'http://www.phpmix.org/projects/drupal/4_7/akismet'); define('AKISMET_MODULE_USERAGENT', 'phpMiX.org | projects/drupal/4_7/akismet | '. AKISMET_MODULE_VERSION); --- 6,10 ---- */ define('AKISMET_DRUPAL_VERSION', '4.7'); ! define('AKISMET_MODULE_VERSION', '1.1.2'); define('AKISMET_MODULE_HOMEURL', 'http://www.phpmix.org/projects/drupal/4_7/akismet'); define('AKISMET_MODULE_USERAGENT', 'phpMiX.org | projects/drupal/4_7/akismet | '. AKISMET_MODULE_VERSION); *************** *** 468,471 **** --- 468,477 ---- */ function _akismet_node_form_validate($form_id, $form_values) { + // Quit if there have already been errors in the form. + if (form_get_errors()) { + return; + } + + // Ok, let's build a quick query to see if we can catch a spambot. global $user; $antispambot_rules = akismet_get_anti_spambot_rules(); *************** *** 476,487 **** $sql_args[] = $_SERVER['REMOTE_ADDR']; } ! if ($antispambot_rules['body']) { $sql_where[] = 'n.body = \'%s\''; $sql_args[] = $form_values['body']; } ! if ($antispambot_rules['mail']) { $sql_where[] = 's.mail = \'%s\''; ! $sql_args[] = (isset($user->mail) ? $user->mail : ''); } if (count($sql_where) > 0) { if ($antispambot_rules['body'] || $antispambot_rules['mail']) { --- 482,494 ---- $sql_args[] = $_SERVER['REMOTE_ADDR']; } ! if ($antispambot_rules['body'] && !empty($form_values['body'])) { $sql_where[] = 'n.body = \'%s\''; $sql_args[] = $form_values['body']; } ! if ($antispambot_rules['mail'] && !empty($user->mail)) { $sql_where[] = 's.mail = \'%s\''; ! $sql_args[] = $user->mail; } + if (count($sql_where) > 0) { if ($antispambot_rules['body'] || $antispambot_rules['mail']) { *************** *** 493,497 **** $sql_stmt = str_replace('%cond', implode(' OR ', $sql_where), $sql_stmt); if (db_result(db_query($sql_stmt, $sql_args, 0, 1))) { ! akismet_anti_spambot_action(array(t('SQL') => $sql_stmt, t('E-mail') => (isset($user->mail) ? $user->mail : ''), t('Body') => $form_values['body'])); } } --- 500,508 ---- $sql_stmt = str_replace('%cond', implode(' OR ', $sql_where), $sql_stmt); if (db_result(db_query($sql_stmt, $sql_args, 0, 1))) { ! akismet_anti_spambot_action(array( ! t('SQL') => _akismet_translate_query($sql_stmt, $sql_args), ! t('E-mail') => (isset($user->mail) ? $user->mail : ''), ! t('Body') => $form_values['body'] ! )); } } *************** *** 502,505 **** --- 513,522 ---- */ function _akismet_comment_form_validate($form_id, $form_values) { + // Quit if there have already been errors in the form. + if (form_get_errors()) { + return; + } + + // Ok, let's build a quick query to see if we can catch a spambot. $antispambot_rules = akismet_get_anti_spambot_rules(); $sql_where = array(); *************** *** 509,517 **** $sql_args[] = $_SERVER['REMOTE_ADDR']; } ! if ($antispambot_rules['body']) { $sql_where[] = 'c.comment = \'%s\''; $sql_args[] = $form_values['comment']; } ! if ($antispambot_rules['mail']) { $sql_where[] = 's.mail = \'%s\''; $sql_args[] = $form_values['mail']; --- 526,534 ---- $sql_args[] = $_SERVER['REMOTE_ADDR']; } ! if ($antispambot_rules['body'] && !empty($form_values['comment'])) { $sql_where[] = 'c.comment = \'%s\''; $sql_args[] = $form_values['comment']; } ! if ($antispambot_rules['mail'] && !empty($form_values['mail'])) { $sql_where[] = 's.mail = \'%s\''; $sql_args[] = $form_values['mail']; *************** *** 527,531 **** $sql_stmt = str_replace('%cond', implode(' OR ', $sql_where), $sql_stmt); if (db_result(db_query($sql_stmt, $sql_args, 0, 1))) { ! akismet_anti_spambot_action(array(t('SQL') => $sql_stmt, t('E-mail') => $form_values['mail'], t('Comment') => $form_values['comment'])); } } --- 544,552 ---- $sql_stmt = str_replace('%cond', implode(' OR ', $sql_where), $sql_stmt); if (db_result(db_query($sql_stmt, $sql_args, 0, 1))) { ! akismet_anti_spambot_action(array( ! t('SQL') => _akismet_translate_query($sql_stmt, $sql_args), ! t('E-mail') => $form_values['mail'], ! t('Comment') => $form_values['comment'] ! )); } } *************** *** 694,697 **** --- 715,736 ---- /** + * Expand query for debugging purposes. + * + * @param string SQL statement. + * @param mixed array or variable list of arguments. + */ + function _akismet_translate_query($query) { + $args = func_get_args(); + array_shift($args); + $query = db_prefix_tables($query); + if (isset($args[0]) && is_array($args[0])) { // 'All arguments in one array' syntax + $args = $args[0]; + } + _db_query_callback($args, TRUE); + $query = preg_replace_callback(DB_QUERY_REGEXP, '_db_query_callback', $query); + return $query; + } + + /** * Check if specified content is marked as spam. * |