Changeset 3292708
- Timestamp:
- 05/13/2025 03:58:49 PM (9 months ago)
- Location:
- flex-forms
- Files:
-
- 4 edited
- 5 copied
-
tags/1.0.2 (copied) (copied from flex-forms/trunk)
-
tags/1.0.2/flex-forms.php (copied) (copied from flex-forms/trunk/flex-forms.php) (3 diffs)
-
tags/1.0.2/includes/class-flex-forms-frontend.php (copied) (copied from flex-forms/trunk/includes/class-flex-forms-frontend.php) (5 diffs)
-
tags/1.0.2/includes/class-flex-forms-settings.php (copied) (copied from flex-forms/trunk/includes/class-flex-forms-settings.php)
-
tags/1.0.2/includes/class-flex-forms-submissions.php (copied) (copied from flex-forms/trunk/includes/class-flex-forms-submissions.php)
-
tags/1.0.2/readme.txt (modified) (1 diff)
-
trunk/flex-forms.php (modified) (3 diffs)
-
trunk/includes/class-flex-forms-frontend.php (modified) (5 diffs)
-
trunk/readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
flex-forms/tags/1.0.2/flex-forms.php
r3279209 r3292708 4 4 * Plugin URI: https://flex-fields.com/forms/ 5 5 * Description: A modular, customizable form builder plugin for WordPress. 6 * Version: 1.0. 06 * Version: 1.0.2 7 7 * Requires at least: 6.6 8 8 * Author: Future Systems … … 17 17 } 18 18 19 define('FLEX_FORMS_VERSION', '1.0. 0');19 define('FLEX_FORMS_VERSION', '1.0.2'); 20 20 define('FLEX_FORMS_PLUGIN_DIR', plugin_dir_path(__FILE__)); 21 21 define('FLEX_FORMS_PLUGIN_URL', plugin_dir_url(__FILE__)); … … 38 38 } 39 39 add_action('plugins_loaded', 'flex_forms_init'); 40 add_action( 'wp_mail_failed', function ( $wp_error ) {41 error_log( 'Mail error: ' . $wp_error->get_error_message() );42 error_log( print_r( $wp_error, true ) );43 });44 40 45 41 function flex_forms_activate_or_deactivate() -
flex-forms/tags/1.0.2/includes/class-flex-forms-frontend.php
r3279209 r3292708 62 62 ?> 63 63 <form id="flex-form-<?php echo esc_attr($form_id); ?>" class="flex-form" method="post" 64 enctype="multipart/form-data">64 enctype="multipart/form-data"> 65 65 <?php 66 $allowed_html = [ 67 'form' => ['action' => [], 'method' => [], 'class' => [], 'id' => []], 68 'input' => ['type' => [], 'name' => [], 'value' => [], 'class' => [], 'id' => [], 'placeholder' => [], 'required' => []], 69 'textarea' => ['name' => [], 'rows' => [], 'cols' => [], 'class' => [], 'id' => [], 'placeholder' => [], 'required' => []], 70 'label' => ['for' => [], 'class' => []], 71 'select' => ['name' => [], 'class' => [], 'id' => []], 72 'option' => ['value' => [], 'selected' => []], 73 'button' => ['type' => [], 'class' => [], 'id' => []] 74 ]; 66 $allowed_html = array_merge_recursive( 67 wp_kses_allowed_html('post'), 68 [ 69 'form' => [ 70 'action' => true, 71 'method' => true, 72 'class' => true, 73 'id' => true 74 ], 75 'input' => [ 76 'type' => true, 77 'name' => true, 78 'value' => true, 79 'class' => true, 80 'id' => true, 81 'placeholder' => true, 82 'required' => true, 83 'checked' => true, 84 'multiple' => true 85 ], 86 'textarea' => [ 87 'name' => true, 88 'rows' => true, 89 'cols' => true, 90 'class' => true, 91 'id' => true, 92 'placeholder' => true, 93 'required' => true 94 ], 95 'label' => [ 96 'for' => true, 97 'class' => true 98 ], 99 'select' => [ 100 'name' => true, 101 'class' => true, 102 'id' => true, 103 'required' => true, 104 'multiple' => true 105 ], 106 'option' => [ 107 'value' => true, 108 'selected' => true 109 ], 110 'button' => [ 111 'type' => true, 112 'class' => true, 113 'id' => true 114 ] 115 ] 116 ); 75 117 76 118 echo wp_kses($form_content, $allowed_html); … … 183 225 184 226 $submission_data = []; 185 if ( isset( $_POST['flex_forms_all_inputs'] ) ) { 186 $all_inputs = sanitize_text_field( wp_unslash( $_POST['flex_forms_all_inputs'] ) ); 187 $flex_all_inputs = explode( ',', $all_inputs ); 188 foreach ( $flex_all_inputs as $input ) { 189 if ( isset( $_POST[ $input ] ) ) { 190 $submission_data[ $input ] = wp_kses( wp_unslash( $_POST[ $input ] ), 'post' ); 191 } 192 } 193 } 194 195 $submission_data['_referrer_url'] = isset( $_SERVER['HTTP_REFERER'] ) 196 ? esc_url_raw( $_SERVER['HTTP_REFERER'] ) 197 : ''; 227 if (isset($_POST['flex_forms_all_inputs'])) { 228 $all_inputs = sanitize_text_field(wp_unslash($_POST['flex_forms_all_inputs'])); 229 $flex_all_inputs = explode(',', $all_inputs); 230 foreach ($flex_all_inputs as $input) { 231 if (isset($_POST[$input])) { 232 $submission_data[$input] = wp_kses(wp_unslash($_POST[$input]), 'post'); 233 } 234 } 235 } 198 236 199 237 $submission_post = array( … … 226 264 $user_email_template = get_post_meta($form_id, '_flex_forms_user_email_template', true); 227 265 preg_match('/\[(.*?)\]/', $user_email_shortcode, $matches); 228 229 $user_email = ''; 230 if ( isset($matches[1]) && isset($submission_data[$matches[1]]) ) { 231 $user_email = sanitize_email($submission_data[$matches[1]]); 232 } 233 266 $user_email = isset($submission_data[$matches[1]]) ? sanitize_email($submission_data[$matches[1]]) : ''; 234 267 if (!empty($user_email) && !empty($user_email_subject) && !empty($user_email_template)) { 235 268 foreach ($submission_data as $key => $value) { … … 284 317 $phpmailer->Port = get_option( 'flex_forms_smtp_port' ); 285 318 286 $smtp_encryption = strtolower( get_option( 'flex_forms_smtp_encryption', 'none' ) ); 287 288 if ( $smtp_encryption === 'none' ) { 319 $smtp_encryption = get_option( 'flex_forms_smtp_encryption' ); 320 if ( 'none' === strtolower( $smtp_encryption ) ) { 289 321 $phpmailer->SMTPSecure = ''; 290 $phpmailer->SMTPAutoTLS = false; // don’t attempt STARTTLS322 $phpmailer->SMTPAutoTLS = false; 291 323 $phpmailer->SMTPOptions = array( 292 324 'ssl' => array( … … 296 328 ), 297 329 ); 298 } elseif ( in_array( $smtp_encryption, [ 'ssl', 'tls' ], true ) ) {299 $phpmailer->SMTPSecure = $smtp_encryption; // ssl or tls300 330 } else { 301 $phpmailer->SMTPSecure = ''; // fallback331 $phpmailer->SMTPSecure = $smtp_encryption; 302 332 } 303 333 304 334 $phpmailer->CharSet = 'UTF-8'; 305 $phpmailer->isHTML( true);335 $phpmailer->isHTML(true); 306 336 $phpmailer->setFrom($from_email, $from_name); 307 337 }); -
flex-forms/tags/1.0.2/readme.txt
r3270373 r3292708 4 4 Tags: form, field, shortcode, input, email 5 5 Requires at least: 5.0 6 Tested up to: 6. 76 Tested up to: 6.8 7 7 Requires PHP: 7.0 8 Stable tag: 1.0. 08 Stable tag: 1.0.2 9 9 License: GPLv2 or later 10 10 License URI: https://www.gnu.org/licenses/gpl-2.0.html -
flex-forms/trunk/flex-forms.php
r3279209 r3292708 4 4 * Plugin URI: https://flex-fields.com/forms/ 5 5 * Description: A modular, customizable form builder plugin for WordPress. 6 * Version: 1.0. 06 * Version: 1.0.2 7 7 * Requires at least: 6.6 8 8 * Author: Future Systems … … 17 17 } 18 18 19 define('FLEX_FORMS_VERSION', '1.0. 0');19 define('FLEX_FORMS_VERSION', '1.0.2'); 20 20 define('FLEX_FORMS_PLUGIN_DIR', plugin_dir_path(__FILE__)); 21 21 define('FLEX_FORMS_PLUGIN_URL', plugin_dir_url(__FILE__)); … … 38 38 } 39 39 add_action('plugins_loaded', 'flex_forms_init'); 40 add_action( 'wp_mail_failed', function ( $wp_error ) {41 error_log( 'Mail error: ' . $wp_error->get_error_message() );42 error_log( print_r( $wp_error, true ) );43 });44 40 45 41 function flex_forms_activate_or_deactivate() -
flex-forms/trunk/includes/class-flex-forms-frontend.php
r3279209 r3292708 62 62 ?> 63 63 <form id="flex-form-<?php echo esc_attr($form_id); ?>" class="flex-form" method="post" 64 enctype="multipart/form-data">64 enctype="multipart/form-data"> 65 65 <?php 66 $allowed_html = [ 67 'form' => ['action' => [], 'method' => [], 'class' => [], 'id' => []], 68 'input' => ['type' => [], 'name' => [], 'value' => [], 'class' => [], 'id' => [], 'placeholder' => [], 'required' => []], 69 'textarea' => ['name' => [], 'rows' => [], 'cols' => [], 'class' => [], 'id' => [], 'placeholder' => [], 'required' => []], 70 'label' => ['for' => [], 'class' => []], 71 'select' => ['name' => [], 'class' => [], 'id' => []], 72 'option' => ['value' => [], 'selected' => []], 73 'button' => ['type' => [], 'class' => [], 'id' => []] 74 ]; 66 $allowed_html = array_merge_recursive( 67 wp_kses_allowed_html('post'), 68 [ 69 'form' => [ 70 'action' => true, 71 'method' => true, 72 'class' => true, 73 'id' => true 74 ], 75 'input' => [ 76 'type' => true, 77 'name' => true, 78 'value' => true, 79 'class' => true, 80 'id' => true, 81 'placeholder' => true, 82 'required' => true, 83 'checked' => true, 84 'multiple' => true 85 ], 86 'textarea' => [ 87 'name' => true, 88 'rows' => true, 89 'cols' => true, 90 'class' => true, 91 'id' => true, 92 'placeholder' => true, 93 'required' => true 94 ], 95 'label' => [ 96 'for' => true, 97 'class' => true 98 ], 99 'select' => [ 100 'name' => true, 101 'class' => true, 102 'id' => true, 103 'required' => true, 104 'multiple' => true 105 ], 106 'option' => [ 107 'value' => true, 108 'selected' => true 109 ], 110 'button' => [ 111 'type' => true, 112 'class' => true, 113 'id' => true 114 ] 115 ] 116 ); 75 117 76 118 echo wp_kses($form_content, $allowed_html); … … 183 225 184 226 $submission_data = []; 185 if ( isset( $_POST['flex_forms_all_inputs'] ) ) { 186 $all_inputs = sanitize_text_field( wp_unslash( $_POST['flex_forms_all_inputs'] ) ); 187 $flex_all_inputs = explode( ',', $all_inputs ); 188 foreach ( $flex_all_inputs as $input ) { 189 if ( isset( $_POST[ $input ] ) ) { 190 $submission_data[ $input ] = wp_kses( wp_unslash( $_POST[ $input ] ), 'post' ); 191 } 192 } 193 } 194 195 $submission_data['_referrer_url'] = isset( $_SERVER['HTTP_REFERER'] ) 196 ? esc_url_raw( $_SERVER['HTTP_REFERER'] ) 197 : ''; 227 if (isset($_POST['flex_forms_all_inputs'])) { 228 $all_inputs = sanitize_text_field(wp_unslash($_POST['flex_forms_all_inputs'])); 229 $flex_all_inputs = explode(',', $all_inputs); 230 foreach ($flex_all_inputs as $input) { 231 if (isset($_POST[$input])) { 232 $submission_data[$input] = wp_kses(wp_unslash($_POST[$input]), 'post'); 233 } 234 } 235 } 198 236 199 237 $submission_post = array( … … 226 264 $user_email_template = get_post_meta($form_id, '_flex_forms_user_email_template', true); 227 265 preg_match('/\[(.*?)\]/', $user_email_shortcode, $matches); 228 229 $user_email = ''; 230 if ( isset($matches[1]) && isset($submission_data[$matches[1]]) ) { 231 $user_email = sanitize_email($submission_data[$matches[1]]); 232 } 233 266 $user_email = isset($submission_data[$matches[1]]) ? sanitize_email($submission_data[$matches[1]]) : ''; 234 267 if (!empty($user_email) && !empty($user_email_subject) && !empty($user_email_template)) { 235 268 foreach ($submission_data as $key => $value) { … … 284 317 $phpmailer->Port = get_option( 'flex_forms_smtp_port' ); 285 318 286 $smtp_encryption = strtolower( get_option( 'flex_forms_smtp_encryption', 'none' ) ); 287 288 if ( $smtp_encryption === 'none' ) { 319 $smtp_encryption = get_option( 'flex_forms_smtp_encryption' ); 320 if ( 'none' === strtolower( $smtp_encryption ) ) { 289 321 $phpmailer->SMTPSecure = ''; 290 $phpmailer->SMTPAutoTLS = false; // don’t attempt STARTTLS322 $phpmailer->SMTPAutoTLS = false; 291 323 $phpmailer->SMTPOptions = array( 292 324 'ssl' => array( … … 296 328 ), 297 329 ); 298 } elseif ( in_array( $smtp_encryption, [ 'ssl', 'tls' ], true ) ) {299 $phpmailer->SMTPSecure = $smtp_encryption; // ssl or tls300 330 } else { 301 $phpmailer->SMTPSecure = ''; // fallback331 $phpmailer->SMTPSecure = $smtp_encryption; 302 332 } 303 333 304 334 $phpmailer->CharSet = 'UTF-8'; 305 $phpmailer->isHTML( true);335 $phpmailer->isHTML(true); 306 336 $phpmailer->setFrom($from_email, $from_name); 307 337 }); -
flex-forms/trunk/readme.txt
r3270373 r3292708 4 4 Tags: form, field, shortcode, input, email 5 5 Requires at least: 5.0 6 Tested up to: 6. 76 Tested up to: 6.8 7 7 Requires PHP: 7.0 8 Stable tag: 1.0. 08 Stable tag: 1.0.2 9 9 License: GPLv2 or later 10 10 License URI: https://www.gnu.org/licenses/gpl-2.0.html
Note: See TracChangeset
for help on using the changeset viewer.