Server IP : 104.21.14.48 / Your IP : 13.59.8.231 [ Web Server : Apache System : Linux b70eb322-3aee-0c53-7c82-0db91281f2c6.secureserver.net 6.1.90-1.el9.elrepo.x86_64 #1 SMP PREEMPT_DYNAMIC Thu May 2 12:09:22 EDT 2024 x86_64 User : root ( 0) PHP Version : 8.0.30.2 Disable Function : NONE Domains : 0 Domains MySQL : ON | cURL : ON | WGET : ON | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /var/www/wp-content/plugins/profile-builder/admin/advanced-settings/includes/fields/ |
Upload File : |
<?php // Exit if accessed directly if ( ! defined( 'ABSPATH' ) ) exit; $affected_fields = wppb_toolbox_get_settings( 'fields', 'restricted-words-fields' ); if ( $affected_fields != false ) { foreach ( $affected_fields as $field ) add_filter( 'wppb_check_form_field_default-' . $field, 'wppb_toolbox_check_banned_words', 20, 4 ); } function wppb_toolbox_check_banned_words( $message, $field, $request_data, $form_location ){ $meta_name = str_replace( 'wppb_check_form_field_default-', '', current_filter() ); $meta_name = str_replace( '-', '_', $meta_name ); if( empty( $request_data[ $meta_name ] ) ) return $message; $banned_words = wppb_toolbox_get_settings( 'fields', 'restricted-words-data' ); if ( $banned_words == false ) return $message; $validation_message = wppb_toolbox_get_settings( 'fields', 'restricted-words-message' ); foreach ( $banned_words as $banned ) { if ( strpos( $request_data[ $meta_name ], $banned ) !== false) { return $validation_message; } } return $message; }