Changeset 3393619
- Timestamp:
- 11/11/2025 12:06:45 PM (5 weeks ago)
- Location:
- fv-antispam/trunk
- Files:
-
- 2 edited
-
fv-antispam.php (modified) (6 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
fv-antispam/trunk/fv-antispam.php
r3215411 r3393619 5 5 Description: Powerful and simple antispam plugin. Puts all the spambot comments directly into trash and let's other plugins (Akismet) deal with the rest. 6 6 Author: Foliovision 7 Version: 2. 77 Version: 2.8 8 8 Author URI: http://www.foliovision.com 9 9 */ 10 10 11 11 12 $fv_antispam_ver = '2. 7';12 $fv_antispam_ver = '2.8'; 13 13 $FV_Antispam_iFilledInCount = 0; 14 14 $FV_Antispam_bMathJS = false; … … 551 551 $date = date('Y-m-d H:i:s' ,mktime(0, 0, 0, date("m")-1, date("d"), date("Y"))); 552 552 } 553 554 if ( ! $date ) { 555 return; 556 } 557 553 558 $comments = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_id NOT IN ( select comment_id from $wpdb->commentmeta where meta_key = '_wp_trash_meta_time' ) AND comment_date_gmt < '$date' AND comment_approved = 'trash' ORDER BY comment_date_gmt ASC LIMIT 5000"); 554 559 if( count($comments) ) { … … 1042 1047 1043 1048 function disp__login_form_js() { 1049 $key = $this->func__ip_protect(); 1044 1050 $value = !empty($_POST[$this->func__ip_protect()]) ? $_POST[$this->func__ip_protect()] : ''; 1045 1051 ?> … … 1047 1053 jQuery(document).ready(function() { 1048 1054 jQuery( '#user_email').after( 1049 jQuery("#user_email").clone().attr('id', '<?php echo $this->func__ip_protect(); ?>').attr('name', '<?php echo $this->func__ip_protect(); ?>').attr('value', '<?php echo $value; ?>')1055 jQuery("#user_email").clone().attr('id', '<?php echo esc_js( $key ); ?>').attr('name', '<?php echo esc_js( $key ); ?>').attr('value', '<?php echo esc_attr( $value ); ?>') 1050 1056 ); 1051 1057 jQuery("#user_email").hide(); … … 1660 1666 $sTextarea = $aMatch[1]; 1661 1667 1662 preg_match( '/class=[ \"\'](.*?)[\"\']/', $sTextarea, $class );1668 preg_match( '/class=["\'](.*?)["\']/', $sTextarea, $class ); 1663 1669 preg_match( '/id=[\"\'](.*?)[\"\']/', $sTextarea, $id ); 1664 1670 preg_match( '/name=[\"\'](.*?)[\"\']/', $sTextarea, $name ); 1671 preg_match( '/\s*?required=["\'](.*?)["\']/', $sTextarea, $required ); 1665 1672 1666 1673 $sClass = !empty($class) ? $class[1] : false; 1667 1674 $sID = $id[1]; 1668 1675 $sName = $name[1]; 1676 $sRequired = !empty( $required ) ? $required[0] : false; 1669 1677 1670 1678 $sTextarea = preg_replace('~<textarea([^\>]*>).*?</textarea>~', "<textarea$1</textarea>", $sTextarea ); // have to keep the hidden textarea empty 1671 1679 1680 // Remove the required attribute from the textarea 1681 $sTextarea = str_replace( $sRequired, '', $sTextarea ); 1682 1672 1683 $sProtect = FV_Antispam::func__protect($post->ID); 1673 1684 … … 1780 1791 $_POST['user_email'] = ( $_POST['user_email'] ) ? $_POST['user_email'] : $_POST[$this->func__ip_protect()]; 1781 1792 } else if( isset($_POST['user_email']) && trim($_POST['user_email']) != "" ) { 1782 $fv_antispam_registrations = get_option('fv_antispam_registrations'); 1783 $fv_antispam_registrations = ( $fv_antispam_registrations ) ? $fv_antispam_registrations : array(); 1793 $fv_antispam_registrations = get_option('fv_antispam_registrations', array() ); 1794 1795 // Go through $fv_antispam_registrations and remove items older than 1 year 1796 $keep_recent_only = array(); 1797 foreach( $fv_antispam_registrations as $line ) { 1798 if ( strtotime( $line['date'] ) > strtotime( '-1 year' ) ) { 1799 $keep_recent_only[] = $line; 1800 } 1801 } 1802 $fv_antispam_registrations = $keep_recent_only; 1803 1784 1804 $fv_antispam_registrations[] = array( 'date' => date('r'), 'user_login' => $_POST['user_login'], 'user_email' => $_POST['user_email'] ); 1785 update_option( 'fv_antispam_registrations', $fv_antispam_registrations );1805 update_option( 'fv_antispam_registrations', $fv_antispam_registrations, false ); 1786 1806 unset($_POST['user_email']); 1787 1807 -
fv-antispam/trunk/readme.txt
r3215161 r3393619 3 3 Tags: antispam, spam, akismet 4 4 Requires at least: 3.5 5 Tested up to: 6. 75 Tested up to: 6.8 6 6 Stable tag: trunk 7 7 … … 39 39 40 40 == Changelog == 41 42 = 2.8 = 43 44 * Security: Avoid CSRF on the wp-login.php registration page 45 * WordPress 6.8 fix for the "required" attribute on comment textarea 41 46 42 47 = 2.7 =
Note: See TracChangeset
for help on using the changeset viewer.