Changeset 2959434
- Timestamp:
- 08/28/2023 02:38:59 PM (3 years ago)
- Location:
- gravity-forms-email-blacklist
- Files:
-
- 6 edited
- 1 copied
-
tags/2.5.4 (copied) (copied from gravity-forms-email-blacklist/trunk)
-
tags/2.5.4/gf-emailblacklist.php (modified) (1 diff)
-
tags/2.5.4/includes/class-gfemailblacklist.php (modified) (6 diffs)
-
tags/2.5.4/readme.txt (modified) (1 diff)
-
trunk/gf-emailblacklist.php (modified) (1 diff)
-
trunk/includes/class-gfemailblacklist.php (modified) (6 diffs)
-
trunk/readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
gravity-forms-email-blacklist/tags/2.5.4/gf-emailblacklist.php
r2888656 r2959434 4 4 * Plugin URI: https://wordpress.org/plugins/gravity-forms-email-blacklist/ 5 5 * Description: This plugin adds the ability to set a blacklist of domains on the email field in gravity forms. 6 * Version: 2.5. 36 * Version: 2.5.4 7 7 * Author: CrossPeak Software 8 8 * Author URI: https://www.crosspeaksoftware.com/ -
gravity-forms-email-blacklist/tags/2.5.4/includes/class-gfemailblacklist.php
r2888656 r2959434 17 17 class GFEmailBlacklist extends GFAddOn { 18 18 19 protected $_version = '2.5. 3';19 protected $_version = '2.5.4'; 20 20 protected $_min_gravityforms_version = '1.9'; 21 21 protected $_slug = 'gf_email_blacklist'; … … 24 24 protected $_title = 'Gravity Forms Email Blacklist'; 25 25 protected $_short_title = 'Email Blacklist'; 26 27 /** 28 * Defines the capability needed to access the Add-On settings page. 29 * 30 * @since 2.5.4 31 * @access protected 32 * @var string $_capabilities_settings_page The capability needed to access the Add-On settings page. 33 */ 34 protected $_capabilities_settings_page = 'gravityforms_email_blacklist'; 35 36 /** 37 * Defines the capability needed to access the Add-On form settings page. 38 * 39 * @since 2.5.4 40 * @access protected 41 * @var string $_capabilities_form_settings The capability needed to access the Add-On form settings page. 42 */ 43 protected $_capabilities_form_settings = 'gravityforms_email_blacklist'; 44 45 /** 46 * Defines the capability needed to uninstall the Add-On. 47 * 48 * @since 2.5.4 49 * @access protected 50 * @var string $_capabilities_uninstall The capability needed to uninstall the Add-On. 51 */ 52 protected $_capabilities_uninstall = 'gravityforms_email_blacklist_uninstall'; 53 54 /** 55 * Defines the capabilities needed for the Post Creation Add-On 56 * 57 * @since 2.5.4 58 * @access protected 59 * @var array $_capabilities The capabilities needed for the Add-On 60 */ 61 protected $_capabilities = array( 'gravityforms_email_blacklist', 'gravityforms_email_blacklist_uninstall' ); 62 26 63 27 64 private static $_instance = null; … … 169 206 */ 170 207 public function gf_emailblacklist_validation( $validation_result ) { 208 209 // Collect global settings. 210 $blacklist = get_option( 'gravityformsaddon_' . $this->_slug . '_settings' ); 211 if ( is_array( $blacklist ) && ! empty( $blacklist['default_emailblacklist'] ) ) { 212 $blacklist = $blacklist['default_emailblacklist']; 213 } else { 214 $blacklist = ''; 215 } 216 171 217 // Collect form results. 172 218 $form = $validation_result['form']; 219 173 220 // Loop through results. 174 221 foreach ( $form['fields'] as &$field ) { … … 182 229 if ( RGFormsModel::is_field_hidden( $form, $field, array() ) ) { 183 230 continue; 231 } 232 233 // Collect banned domains from backend and clean up. 234 if ( ! empty( $field['email_blacklist'] ) ) { // collect per form settings. 235 $blacklist = $field['email_blacklist']; 184 236 } 185 237 … … 188 240 $domain = $this->gf_emailblacklist_clean( rgar( explode( '@', $email ), 1 ) ); 189 241 $tld = strrchr( $domain, '.' ); 190 191 // Collect banned domains from backend and clean up.192 if ( ! empty( $field['email_blacklist'] ) ) { // collect per form settings.193 $blacklist = $field['email_blacklist'];194 } else { // Collect default settings.195 $blacklist = get_option( 'gravityformsaddon_' . $this->_slug . '_settings' );196 $blacklist = $blacklist['default_emailblacklist'];197 }198 242 199 243 /** … … 216 260 $blacklist = str_replace( '*', '', $blacklist ); 217 261 $blacklist = array_map( array( $this, 'gf_emailblacklist_clean' ), $blacklist ); 262 $blacklist = array_filter( $blacklist ); 263 264 // No blacklisted email, skip. 265 if ( empty( $blacklist ) ) { 266 continue; 267 } 218 268 219 269 // if the email, domain or top-level domain isn't blacklisted, skip. -
gravity-forms-email-blacklist/tags/2.5.4/readme.txt
r2888656 r2959434 63 63 === Changelog === 64 64 65 = 2.5.4 = 66 * Fixed validation function to remove any empty values for the array of blacklisted emails to prevent false positives from empty email fields. 67 * Added capability declination to the class to allow the plugin to work with role and capabilities plugins. 68 65 69 = 2.5.3 = 66 70 * Updated labels and descriptions throughout the admin settings to improve clarity. -
gravity-forms-email-blacklist/trunk/gf-emailblacklist.php
r2888656 r2959434 4 4 * Plugin URI: https://wordpress.org/plugins/gravity-forms-email-blacklist/ 5 5 * Description: This plugin adds the ability to set a blacklist of domains on the email field in gravity forms. 6 * Version: 2.5. 36 * Version: 2.5.4 7 7 * Author: CrossPeak Software 8 8 * Author URI: https://www.crosspeaksoftware.com/ -
gravity-forms-email-blacklist/trunk/includes/class-gfemailblacklist.php
r2888656 r2959434 17 17 class GFEmailBlacklist extends GFAddOn { 18 18 19 protected $_version = '2.5. 3';19 protected $_version = '2.5.4'; 20 20 protected $_min_gravityforms_version = '1.9'; 21 21 protected $_slug = 'gf_email_blacklist'; … … 24 24 protected $_title = 'Gravity Forms Email Blacklist'; 25 25 protected $_short_title = 'Email Blacklist'; 26 27 /** 28 * Defines the capability needed to access the Add-On settings page. 29 * 30 * @since 2.5.4 31 * @access protected 32 * @var string $_capabilities_settings_page The capability needed to access the Add-On settings page. 33 */ 34 protected $_capabilities_settings_page = 'gravityforms_email_blacklist'; 35 36 /** 37 * Defines the capability needed to access the Add-On form settings page. 38 * 39 * @since 2.5.4 40 * @access protected 41 * @var string $_capabilities_form_settings The capability needed to access the Add-On form settings page. 42 */ 43 protected $_capabilities_form_settings = 'gravityforms_email_blacklist'; 44 45 /** 46 * Defines the capability needed to uninstall the Add-On. 47 * 48 * @since 2.5.4 49 * @access protected 50 * @var string $_capabilities_uninstall The capability needed to uninstall the Add-On. 51 */ 52 protected $_capabilities_uninstall = 'gravityforms_email_blacklist_uninstall'; 53 54 /** 55 * Defines the capabilities needed for the Post Creation Add-On 56 * 57 * @since 2.5.4 58 * @access protected 59 * @var array $_capabilities The capabilities needed for the Add-On 60 */ 61 protected $_capabilities = array( 'gravityforms_email_blacklist', 'gravityforms_email_blacklist_uninstall' ); 62 26 63 27 64 private static $_instance = null; … … 169 206 */ 170 207 public function gf_emailblacklist_validation( $validation_result ) { 208 209 // Collect global settings. 210 $blacklist = get_option( 'gravityformsaddon_' . $this->_slug . '_settings' ); 211 if ( is_array( $blacklist ) && ! empty( $blacklist['default_emailblacklist'] ) ) { 212 $blacklist = $blacklist['default_emailblacklist']; 213 } else { 214 $blacklist = ''; 215 } 216 171 217 // Collect form results. 172 218 $form = $validation_result['form']; 219 173 220 // Loop through results. 174 221 foreach ( $form['fields'] as &$field ) { … … 182 229 if ( RGFormsModel::is_field_hidden( $form, $field, array() ) ) { 183 230 continue; 231 } 232 233 // Collect banned domains from backend and clean up. 234 if ( ! empty( $field['email_blacklist'] ) ) { // collect per form settings. 235 $blacklist = $field['email_blacklist']; 184 236 } 185 237 … … 188 240 $domain = $this->gf_emailblacklist_clean( rgar( explode( '@', $email ), 1 ) ); 189 241 $tld = strrchr( $domain, '.' ); 190 191 // Collect banned domains from backend and clean up.192 if ( ! empty( $field['email_blacklist'] ) ) { // collect per form settings.193 $blacklist = $field['email_blacklist'];194 } else { // Collect default settings.195 $blacklist = get_option( 'gravityformsaddon_' . $this->_slug . '_settings' );196 $blacklist = $blacklist['default_emailblacklist'];197 }198 242 199 243 /** … … 216 260 $blacklist = str_replace( '*', '', $blacklist ); 217 261 $blacklist = array_map( array( $this, 'gf_emailblacklist_clean' ), $blacklist ); 262 $blacklist = array_filter( $blacklist ); 263 264 // No blacklisted email, skip. 265 if ( empty( $blacklist ) ) { 266 continue; 267 } 218 268 219 269 // if the email, domain or top-level domain isn't blacklisted, skip. -
gravity-forms-email-blacklist/trunk/readme.txt
r2888656 r2959434 63 63 === Changelog === 64 64 65 = 2.5.4 = 66 * Fixed validation function to remove any empty values for the array of blacklisted emails to prevent false positives from empty email fields. 67 * Added capability declination to the class to allow the plugin to work with role and capabilities plugins. 68 65 69 = 2.5.3 = 66 70 * Updated labels and descriptions throughout the admin settings to improve clarity.
Note: See TracChangeset
for help on using the changeset viewer.