Contact Form Email - Version 1.2.91

Version Description

  • Allowed better email formating and misc improvements
Download this release

Release Info

Developer codepeople
Plugin Icon 128x128 Contact Form Email
Version 1.2.91
Comparing to
See all releases

Code changes from version 1.2.90 to 1.2.91

README.txt CHANGED
@@ -456,6 +456,9 @@ When you click a field already added into the contact form builder area, you can
456
 
457
  == Changelog ==
458
 
 
 
 
459
  = 1.2.90 =
460
  * Code improvements
461
 
@@ -1030,5 +1033,5 @@ When you click a field already added into the contact form builder area, you can
1030
 
1031
  == Upgrade Notice ==
1032
 
1033
- = 1.2.90 =
1034
- * Code improvements
456
 
457
  == Changelog ==
458
 
459
+ = 1.2.91 =
460
+ * Allowed better email formating and misc improvements
461
+
462
  = 1.2.90 =
463
  * Code improvements
464
 
1033
 
1034
  == Upgrade Notice ==
1035
 
1036
+ = 1.2.91 =
1037
+ * Allowed better email formating and misc improvements
banner.php CHANGED
@@ -15,19 +15,20 @@ if(!function_exists( 'codepeople_add_promote_banner' ))
15
  // Take action over the banner
16
  if(isset($_POST['codepeople_promote_banner_nonce']) && wp_verify_nonce($_POST['codepeople_promote_banner_nonce'], __FILE__))
17
  {
 
18
  if(
19
- !empty($_POST['codepeople_promote_banner_plugin']) &&
20
- !empty($codepeople_promote_banner_plugins[$_POST['codepeople_promote_banner_plugin']])
21
  )
22
  {
23
- set_transient( 'codepeople_promote_banner_'.$_POST['codepeople_promote_banner_plugin'], -1, 0);
24
  if(
25
  !empty($_POST['codepeople_promote_banner_action']) &&
26
  $_POST['codepeople_promote_banner_action'] == 'set-review' &&
27
- !empty($codepeople_promote_banner_plugins[$_POST['codepeople_promote_banner_plugin']]['plugin_url'])
28
  )
29
  {
30
- print '<script>document.location.href="'.esc_js($codepeople_promote_banner_plugins[$_POST['codepeople_promote_banner_plugin']]['plugin_url']).'";</script>';
31
  }
32
  }
33
  }
15
  // Take action over the banner
16
  if(isset($_POST['codepeople_promote_banner_nonce']) && wp_verify_nonce($_POST['codepeople_promote_banner_nonce'], __FILE__))
17
  {
18
+ $codepeople_promote_banner_plugin = sanitize_key($_POST['codepeople_promote_banner_plugin']);
19
  if(
20
+ !empty($codepeople_promote_banner_plugin) &&
21
+ !empty($codepeople_promote_banner_plugins[$codepeople_promote_banner_plugin])
22
  )
23
  {
24
+ set_transient( 'codepeople_promote_banner_'.$codepeople_promote_banner_plugin, -1, 0);
25
  if(
26
  !empty($_POST['codepeople_promote_banner_action']) &&
27
  $_POST['codepeople_promote_banner_action'] == 'set-review' &&
28
+ !empty($codepeople_promote_banner_plugins[$codepeople_promote_banner_plugin]['plugin_url'])
29
  )
30
  {
31
+ print '<script>document.location.href="'.esc_js($codepeople_promote_banner_plugins[$codepeople_promote_banner_plugin]['plugin_url']).'";</script>';
32
  }
33
  }
34
  }
bannerdk.php CHANGED
@@ -18,19 +18,20 @@ if(!function_exists( 'codepeople_add_promotecftedk_banner' ))
18
  // Take action over the banner
19
  if(isset($_POST['codepeople_cftedk_banner_nonce']) && wp_verify_nonce($_POST['codepeople_cftedk_banner_nonce'], __FILE__))
20
  {
 
21
  if(
22
- !empty($_POST['codepeople_cftedk_banner_plugin']) &&
23
- !empty($codepeople_cftedk_banner_plugins[$_POST['codepeople_cftedk_banner_plugin']])
24
  )
25
  {
26
- set_transient( 'codepeople_cftedk_banner_'.$_POST['codepeople_cftedk_banner_plugin'], -1, 0);
27
  if(
28
  !empty($_POST['codepeople_cftedk_banner_action']) &&
29
  $_POST['codepeople_cftedk_banner_action'] == 'set-review' &&
30
- !empty($codepeople_cftedk_banner_plugins[$_POST['codepeople_cftedk_banner_plugin']]['plugin_url'])
31
  )
32
  {
33
- print '<script>document.location.href="'.esc_js($codepeople_cftedk_banner_plugins[$_POST['codepeople_cftedk_banner_plugin']]['plugin_url']).'";</script>';
34
  }
35
  }
36
  }
18
  // Take action over the banner
19
  if(isset($_POST['codepeople_cftedk_banner_nonce']) && wp_verify_nonce($_POST['codepeople_cftedk_banner_nonce'], __FILE__))
20
  {
21
+ $codepeople_cftedk_banner_plugin = sanitize_key($_POST['codepeople_cftedk_banner_plugin']);
22
  if(
23
+ !empty($codepeople_cftedk_banner_plugin) &&
24
+ !empty($codepeople_cftedk_banner_plugins[$codepeople_cftedk_banner_plugin])
25
  )
26
  {
27
+ set_transient( 'codepeople_cftedk_banner_'.$codepeople_cftedk_banner_plugin, -1, 0);
28
  if(
29
  !empty($_POST['codepeople_cftedk_banner_action']) &&
30
  $_POST['codepeople_cftedk_banner_action'] == 'set-review' &&
31
+ !empty($codepeople_cftedk_banner_plugins[$codepeople_cftedk_banner_plugin]['plugin_url'])
32
  )
33
  {
34
+ print '<script>document.location.href="'.esc_js($codepeople_cftedk_banner_plugins[$codepeople_cftedk_banner_plugin]['plugin_url']).'";</script>';
35
  }
36
  }
37
  }
cp-admin-int-list.inc.php CHANGED
@@ -84,7 +84,7 @@ else if (isset($_GET['u']) && $_GET['u'] != '')
84
  echo 'Error: Form cannot be authenticated (nonce failed). Please contact our <a href="form2email.dwbooster.com/contact-us">support service</a> for verification and solution. Thank you.';
85
  return;
86
  }
87
- $wpdb->query( $wpdb->prepare( 'UPDATE `'.$wpdb->prefix.$this->table_items.'` SET form_name=%s WHERE id=%d', $_GET["name"], $_GET['u'] ) );
88
  $message = "Item updated";
89
  }
90
  else if (isset($_GET['d']) && $_GET['d'] != '')
@@ -122,7 +122,7 @@ else if (isset($_GET['ac']) && $_GET['ac'] == 'st')
122
  update_option( 'CP_CFTE_LOAD_SCRIPTS', ($_GET["scr"]=="1"?"0":"1") );
123
  if ($_GET["chs"] != '')
124
  {
125
- $target_charset = esc_sql($_GET["chs"]);
126
  $tables = array( $wpdb->prefix.$this->table_messages, $wpdb->prefix.$this->table_items );
127
  foreach ($tables as $tab)
128
  {
@@ -142,14 +142,14 @@ else if (isset($_GET['ac']) && $_GET['ac'] == 'st')
142
  }
143
  else if (isset($_POST["cp_cfte_rep_enable"]))
144
  {
145
- update_option( 'cp_cfte_rep_enable', $_POST["cp_cfte_rep_enable"]);
146
- update_option( 'cp_cfte_rep_days', $_POST["cp_cfte_rep_days"]);
147
- update_option( 'cp_cfte_rep_hour', $_POST["cp_cfte_rep_hour"]);
148
- update_option( 'cp_cfte_rep_emails', $_POST["cp_cfte_rep_emails"]);
149
- update_option( 'cp_cfte_fp_from_email', $_POST["cp_cfte_fp_from_email"]);
150
- update_option( 'cp_cfte_rep_subject', $_POST["cp_cfte_rep_subject"]);
151
- update_option( 'cp_cfte_rep_emailformat', $_POST["cp_cfte_rep_emailformat"]);
152
- update_option( 'cp_cfte_rep_message', $_POST["cp_cfte_rep_message"]);
153
  $message = "Report settings updated";
154
  }
155
 
84
  echo 'Error: Form cannot be authenticated (nonce failed). Please contact our <a href="form2email.dwbooster.com/contact-us">support service</a> for verification and solution. Thank you.';
85
  return;
86
  }
87
+ $wpdb->query( $wpdb->prepare( 'UPDATE `'.$wpdb->prefix.$this->table_items.'` SET form_name=%s WHERE id=%d', sanitize_text_field($_GET["name"]), $_GET['u'] ) );
88
  $message = "Item updated";
89
  }
90
  else if (isset($_GET['d']) && $_GET['d'] != '')
122
  update_option( 'CP_CFTE_LOAD_SCRIPTS', ($_GET["scr"]=="1"?"0":"1") );
123
  if ($_GET["chs"] != '')
124
  {
125
+ $target_charset = esc_sql(sanitize_text_field($_GET["chs"]));
126
  $tables = array( $wpdb->prefix.$this->table_messages, $wpdb->prefix.$this->table_items );
127
  foreach ($tables as $tab)
128
  {
142
  }
143
  else if (isset($_POST["cp_cfte_rep_enable"]))
144
  {
145
+ update_option( 'cp_cfte_rep_enable', sanitize_text_field($_POST["cp_cfte_rep_enable"]));
146
+ update_option( 'cp_cfte_rep_days', sanitize_text_field($_POST["cp_cfte_rep_days"]));
147
+ update_option( 'cp_cfte_rep_hour', sanitize_text_field($_POST["cp_cfte_rep_hour"]));
148
+ update_option( 'cp_cfte_rep_emails', sanitize_text_field($_POST["cp_cfte_rep_emails"]));
149
+ update_option( 'cp_cfte_fp_from_email', sanitize_text_field($_POST["cp_cfte_fp_from_email"]));
150
+ update_option( 'cp_cfte_rep_subject', sanitize_text_field($_POST["cp_cfte_rep_subject"]));
151
+ update_option( 'cp_cfte_rep_emailformat', sanitize_text_field($_POST["cp_cfte_rep_emailformat"]));
152
+ update_option( 'cp_cfte_rep_message', sanitize_text_field($_POST["cp_cfte_rep_message"]));
153
  $message = "Report settings updated";
154
  }
155
 
cp-admin-int.inc.php CHANGED
@@ -105,7 +105,7 @@ if ( 'POST' == $_SERVER['REQUEST_METHOD'] && isset( $_POST[$this->prefix.'_post_
105
  </tr>
106
  <tr valign="top">
107
  <th scope="row">"From" email</th>
108
- <td><input required type="email" name="fp_from_email" size="40" value="<?php echo esc_attr($this->get_option('fp_from_email', CP_CFEMAIL_DEFAULT_fp_from_email)); ?>" /><br />
109
  <span style="font-size:10px;color:#666666">
110
  * Email used as "from". Example: admin@<?php echo str_replace('www.','',$_SERVER["HTTP_HOST"]); ?>
111
  </span>
@@ -125,7 +125,7 @@ if ( 'POST' == $_SERVER['REQUEST_METHOD'] && isset( $_POST[$this->prefix.'_post_
125
  <div style="border:1px dotted black;padding:5px 15px 5px 15px;font-size:75%;background-color:#ffffcc">
126
  <p><strong><u>Important note:</u></strong>
127
  It is <strong>strongly recommended to use a "from" email address that belongs to the website domain name</strong>, for example if your website is
128
- <em>http://<?php echo html_entities($_SERVER["HTTP_HOST"]); ?></em> then use an email address like <em>admin@<?php echo str_replace('www.','',$_SERVER["HTTP_HOST"]); ?></em>, this will help to skip a lot of anti-spam restrictions.
129
  Avoid using emails like "<em>...@gmail.com</em>", "<em>...@hotmail.com</em>", "<em>...@aol.com</em>" as "from" addresses since these are identified as originated
130
  at external servers and reach to the spam folder or are completely blocked. This isn't a mandatory requirement but it is strongly recommended.</p>
131
  </div>
105
  </tr>
106
  <tr valign="top">
107
  <th scope="row">"From" email</th>
108
+ <td><input required type="text" name="fp_from_email" size="40" value="<?php echo esc_attr($this->get_option('fp_from_email', CP_CFEMAIL_DEFAULT_fp_from_email)); ?>" /><br />
109
  <span style="font-size:10px;color:#666666">
110
  * Email used as "from". Example: admin@<?php echo str_replace('www.','',$_SERVER["HTTP_HOST"]); ?>
111
  </span>
125
  <div style="border:1px dotted black;padding:5px 15px 5px 15px;font-size:75%;background-color:#ffffcc">
126
  <p><strong><u>Important note:</u></strong>
127
  It is <strong>strongly recommended to use a "from" email address that belongs to the website domain name</strong>, for example if your website is
128
+ <em>http://<?php echo htmlentities($_SERVER["HTTP_HOST"]); ?></em> then use an email address like <em>admin@<?php echo str_replace('www.','',$_SERVER["HTTP_HOST"]); ?></em>, this will help to skip a lot of anti-spam restrictions.
129
  Avoid using emails like "<em>...@gmail.com</em>", "<em>...@hotmail.com</em>", "<em>...@aol.com</em>" as "from" addresses since these are identified as originated
130
  at external servers and reach to the spam folder or are completely blocked. This isn't a mandatory requirement but it is strongly recommended.</p>
131
  </div>
cp-main-class.inc.php CHANGED
@@ -711,7 +711,7 @@ class CP_ContactFormToEmail extends CP_CFTEMAIL_BaseClass {
711
  if ($this->get_param($this->prefix.'_id')) $this->item = $this->get_param($this->prefix.'_id');
712
 
713
  if (function_exists('session_start')) @session_start();
714
- if (isset($_GET["ps"])) $sequence = $_GET["ps"]; else if (isset($_POST["cp_pform_psequence"])) $sequence = $_POST["cp_pform_psequence"];
715
  if (
716
  (!is_admin() && $this->get_option('cv_enable_captcha', CP_CFEMAIL_DEFAULT_cv_enable_captcha) != 'false') &&
717
  ( (strtolower($this->get_param('hdcaptcha_'.$this->prefix.'_post')) != strtolower($_SESSION['rand_code'.$sequence])) ||
@@ -764,7 +764,7 @@ class CP_ContactFormToEmail extends CP_CFTEMAIL_BaseClass {
764
  $buffer = "";
765
  $params = array();
766
  if (!(isset($_POST["edititem"]) && $_POST["edititem"]))
767
- $params["referrer"] = $_POST["refpage".$sequence];
768
  foreach ($_POST as $item => $value)
769
  if (isset($fields[str_replace($sequence,'',$item)]))
770
  {
@@ -823,7 +823,7 @@ class CP_ContactFormToEmail extends CP_CFTEMAIL_BaseClass {
823
  }
824
 
825
  if (isset($_POST["edititem"]) && $_POST["edititem"])
826
- $item_number = $_POST["edititem"];
827
  else
828
  {
829
  $myrows = $wpdb->get_results( "SELECT MAX(id) as max_id FROM ".$wpdb->prefix.$this->table_messages );
@@ -1004,7 +1004,7 @@ class CP_ContactFormToEmail extends CP_CFTEMAIL_BaseClass {
1004
  return;
1005
  }
1006
 
1007
- $this->item = $_POST[$this->prefix."_id"];
1008
 
1009
  if ((substr_count($_POST['form_structure_control'],"\\") > 1) || substr_count($_POST['form_structure_control'],"\\\"title\\\":"))
1010
  foreach ($_POST as $item => $value)
@@ -1347,11 +1347,16 @@ class CP_ContactFormToEmail extends CP_CFTEMAIL_BaseClass {
1347
  }
1348
  if ('html' == get_option('cp_cfte_rep_emailformat','')) $content_type = "Content-Type: text/html; charset=utf-8\n"; else $content_type = "Content-Type: text/plain; charset=utf-8\n";
1349
  if (count($attachments))
 
 
 
 
1350
  wp_mail( str_replace(" ","",str_replace(";",",",get_option('cp_cfte_rep_emails',''))), get_option('cp_cfte_rep_subject',''), get_option('cp_cfte_rep_message','')."\n".$text,
1351
- "From: \"".get_option('cp_cfte_fp_from_email','')."\" <".get_option('cp_cfte_fp_from_email','').">\r\n".
1352
  $content_type.
1353
  "X-Mailer: PHP/" . phpversion(),
1354
  @$attachments);
 
1355
  }
1356
  }
1357
 
@@ -1375,8 +1380,11 @@ class CP_ContactFormToEmail extends CP_CFTEMAIL_BaseClass {
1375
  fclose($handle);
1376
  $attachments = array( $filename );
1377
  if ('html' == $form->rep_emailformat) $content_type = "Content-Type: text/html; charset=utf-8\n"; else $content_type = "Content-Type: text/plain; charset=utf-8\n";
 
 
 
1378
  wp_mail( str_replace(" ","",str_replace(";",",",$form->rep_emails)), $form->rep_subject, $form->rep_message,
1379
- "From: \"".$form->fp_from_email."\" <".$form->fp_from_email.">\r\n".
1380
  $content_type.
1381
  "X-Mailer: PHP/" . phpversion(),
1382
  @$attachments);
711
  if ($this->get_param($this->prefix.'_id')) $this->item = $this->get_param($this->prefix.'_id');
712
 
713
  if (function_exists('session_start')) @session_start();
714
+ if (isset($_GET["ps"])) $sequence = sanitize_key($_GET["ps"]); else if (isset($_POST["cp_pform_psequence"])) $sequence = sanitize_key($_POST["cp_pform_psequence"]);
715
  if (
716
  (!is_admin() && $this->get_option('cv_enable_captcha', CP_CFEMAIL_DEFAULT_cv_enable_captcha) != 'false') &&
717
  ( (strtolower($this->get_param('hdcaptcha_'.$this->prefix.'_post')) != strtolower($_SESSION['rand_code'.$sequence])) ||
764
  $buffer = "";
765
  $params = array();
766
  if (!(isset($_POST["edititem"]) && $_POST["edititem"]))
767
+ $params["referrer"] = esc_url_raw($_POST["refpage".$sequence]);
768
  foreach ($_POST as $item => $value)
769
  if (isset($fields[str_replace($sequence,'',$item)]))
770
  {
823
  }
824
 
825
  if (isset($_POST["edititem"]) && $_POST["edititem"])
826
+ $item_number = intval($_POST["edititem"]);
827
  else
828
  {
829
  $myrows = $wpdb->get_results( "SELECT MAX(id) as max_id FROM ".$wpdb->prefix.$this->table_messages );
1004
  return;
1005
  }
1006
 
1007
+ $this->item = intval($_POST[$this->prefix."_id"]);
1008
 
1009
  if ((substr_count($_POST['form_structure_control'],"\\") > 1) || substr_count($_POST['form_structure_control'],"\\\"title\\\":"))
1010
  foreach ($_POST as $item => $value)
1347
  }
1348
  if ('html' == get_option('cp_cfte_rep_emailformat','')) $content_type = "Content-Type: text/html; charset=utf-8\n"; else $content_type = "Content-Type: text/plain; charset=utf-8\n";
1349
  if (count($attachments))
1350
+ {
1351
+ $from = get_option('cp_cfte_fp_from_email','');
1352
+ if (!strpos($from,">"))
1353
+ $from = '"'.$from.'" <'.$from.'>';
1354
  wp_mail( str_replace(" ","",str_replace(";",",",get_option('cp_cfte_rep_emails',''))), get_option('cp_cfte_rep_subject',''), get_option('cp_cfte_rep_message','')."\n".$text,
1355
+ "From: ".$from."\r\n".
1356
  $content_type.
1357
  "X-Mailer: PHP/" . phpversion(),
1358
  @$attachments);
1359
+ }
1360
  }
1361
  }
1362
 
1380
  fclose($handle);
1381
  $attachments = array( $filename );
1382
  if ('html' == $form->rep_emailformat) $content_type = "Content-Type: text/html; charset=utf-8\n"; else $content_type = "Content-Type: text/plain; charset=utf-8\n";
1383
+ $from = $form->fp_from_email;
1384
+ if (!strpos($from,">"))
1385
+ $from = '"'.$from.'" <'.$from.'>';
1386
  wp_mail( str_replace(" ","",str_replace(";",",",$form->rep_emails)), $form->rep_subject, $form->rep_message,
1387
+ "From: ".$from."\r\n".
1388
  $content_type.
1389
  "X-Mailer: PHP/" . phpversion(),
1390
  @$attachments);
form-to-email.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Contact Form Email
4
  Plugin URI: https://form2email.dwbooster.com/download
5
  Description: Contact form that sends the data to email and also to a database list and CSV file.
6
- Version: 1.2.90
7
  Author: CodePeople
8
  Author URI: https://form2email.dwbooster.com
9
  Text Domain: contact-form-to-email
3
  Plugin Name: Contact Form Email
4
  Plugin URI: https://form2email.dwbooster.com/download
5
  Description: Contact form that sends the data to email and also to a database list and CSV file.
6
+ Version: 1.2.91
7
  Author: CodePeople
8
  Author URI: https://form2email.dwbooster.com
9
  Text Domain: contact-form-to-email