Contact Form Submissions - Version 1.7

Version Description

  • Security fixes
  • Fixed image upload with contact form 7 code change
Download this release

Release Info

Developer jasongreen
Plugin Icon 128x128 Contact Form Submissions
Version 1.7
Comparing to
See all releases

Code changes from version 1.6.4 to 1.7

Files changed (4) hide show
  1. Admin.php +5 -5
  2. Submissions.php +7 -7
  3. contact-form-submissions.php +1 -1
  4. readme.txt +7 -2
Admin.php CHANGED
@@ -83,7 +83,7 @@ class WPCF7SAdmin
83
  <option value="0"><?php _e('Contact Form', 'contact-form-submissions'); ?></option>
84
  <?php foreach ($forms as $post) {
85
  ?>
86
- <?php $selected = ($post->ID == esc_attr($_GET['wpcf7_contact_form'])) ? 'selected' : ''; ?>
87
  <option value="<?php echo $post->ID; ?>" <?php echo $selected; ?>><?php echo $post->post_title; ?></option>
88
  <?php
89
  } ?>
@@ -128,7 +128,7 @@ class WPCF7SAdmin
128
  global $post_type;
129
  if ($query->is_admin && 'wpcf7s' === $post_type && $query->is_main_query()) {
130
  if(isset($_GET['wpcf7_contact_form'])){
131
- $form_id = esc_attr($_GET['wpcf7_contact_form']);
132
  }
133
  if (!empty($form_id)) {
134
  $query->set('meta_query', array(
@@ -155,7 +155,7 @@ class WPCF7SAdmin
155
 
156
  // dynamically add cols if the user selects a form
157
  if (isset($_GET['wpcf7_contact_form']) && !empty($_GET['wpcf7_contact_form'])) {
158
- $form_id = esc_attr($_GET['wpcf7_contact_form']);
159
 
160
  $wpcf7s_columns = $this->get_available_columns($form_id);
161
 
@@ -344,7 +344,7 @@ class WPCF7SAdmin
344
 
345
  <div id="misc-publishing-actions">
346
  <div class="misc-pub-section curtime misc-pub-curtime">
347
- <span id="timestamp"><?php _e('Submitted', 'contact-form-submissions'); ?> : <b><?php echo $date; ?></b></span>
348
  </div>
349
  </div>
350
  <div class="clear"></div>
@@ -454,7 +454,7 @@ class WPCF7SAdmin
454
  $output = fopen('php://output', 'w');
455
 
456
  // add BOM to fix UTF-8 in Excel
457
- fputs($output, $bom =( chr(0xEF) . chr(0xBB) . chr(0xBF) ));
458
 
459
  // use the existing query but get all posts
460
  global $wp_query;
83
  <option value="0"><?php _e('Contact Form', 'contact-form-submissions'); ?></option>
84
  <?php foreach ($forms as $post) {
85
  ?>
86
+ <?php $selected = ($post->ID == sanitize_text_field($_GET['wpcf7_contact_form'])) ? 'selected' : ''; ?>
87
  <option value="<?php echo $post->ID; ?>" <?php echo $selected; ?>><?php echo $post->post_title; ?></option>
88
  <?php
89
  } ?>
128
  global $post_type;
129
  if ($query->is_admin && 'wpcf7s' === $post_type && $query->is_main_query()) {
130
  if(isset($_GET['wpcf7_contact_form'])){
131
+ $form_id = sanitize_text_field($_GET['wpcf7_contact_form']);
132
  }
133
  if (!empty($form_id)) {
134
  $query->set('meta_query', array(
155
 
156
  // dynamically add cols if the user selects a form
157
  if (isset($_GET['wpcf7_contact_form']) && !empty($_GET['wpcf7_contact_form'])) {
158
+ $form_id = sanitize_text_field($_GET['wpcf7_contact_form']);
159
 
160
  $wpcf7s_columns = $this->get_available_columns($form_id);
161
 
344
 
345
  <div id="misc-publishing-actions">
346
  <div class="misc-pub-section curtime misc-pub-curtime">
347
+ <span id="timestamp"><?php _e('Submitted', 'contact-form-submissions'); ?> : <strong><?php echo $date; ?></strong></span>
348
  </div>
349
  </div>
350
  <div class="clear"></div>
454
  $output = fopen('php://output', 'w');
455
 
456
  // add BOM to fix UTF-8 in Excel
457
+ fputs($output, ( chr(0xEF) . chr(0xBB) . chr(0xBF) ));
458
 
459
  // use the existing query but get all posts
460
  global $wp_query;
Submissions.php CHANGED
@@ -186,10 +186,14 @@ class WPCF7Submissions
186
 
187
  foreach ($attachments as $name => $file_path) {
188
  if (!empty($file_path)) {
 
 
 
 
189
  // get the file name
190
  $file_name = basename($file_path);
191
 
192
- $copied = copy($file_path, $wpcf7s_dir . '/' . $file_name);
193
 
194
  add_post_meta($post_id, 'wpcf7s_file-' . $name, $file_name, false);
195
  }
@@ -208,9 +212,7 @@ class WPCF7Submissions
208
  */
209
  public function get_wpcf7s_dir(){
210
  $upload_dir = wp_upload_dir();
211
- $wpcf7s_dir = apply_filters('wpcf7s_dir', $upload_dir['basedir'] .'/wpcf7-submissions');
212
-
213
- return $wpcf7s_dir;
214
  }
215
 
216
  /**
@@ -220,8 +222,6 @@ class WPCF7Submissions
220
  */
221
  public function get_wpcf7s_url(){
222
  $upload_dir = wp_upload_dir();
223
- $wpcf7s_url = apply_filters('wpcf7s_url', $upload_dir['baseurl'] .'/wpcf7-submissions');
224
-
225
- return $wpcf7s_url;
226
  }
227
  }
186
 
187
  foreach ($attachments as $name => $file_path) {
188
  if (!empty($file_path)) {
189
+ if(is_array($file_path)){
190
+ $file_path = current($file_path);
191
+ }
192
+
193
  // get the file name
194
  $file_name = basename($file_path);
195
 
196
+ copy($file_path,$wpcf7s_dir . '/' . $file_name);
197
 
198
  add_post_meta($post_id, 'wpcf7s_file-' . $name, $file_name, false);
199
  }
212
  */
213
  public function get_wpcf7s_dir(){
214
  $upload_dir = wp_upload_dir();
215
+ return apply_filters('wpcf7s_dir', $upload_dir['basedir'] .'/wpcf7-submissions');
 
 
216
  }
217
 
218
  /**
222
  */
223
  public function get_wpcf7s_url(){
224
  $upload_dir = wp_upload_dir();
225
+ return apply_filters('wpcf7s_url', $upload_dir['baseurl'] .'/wpcf7-submissions');
 
 
226
  }
227
  }
contact-form-submissions.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  Plugin Name: Contact Form Submissions
4
  Description: Never miss an enquiry again! Save all Contact Form 7 submissions in your database.
5
- Version: 1.6.4
6
  Author: Jason Green
7
  License: GPLv3
8
  Domain Path: /languages
2
  /*
3
  Plugin Name: Contact Form Submissions
4
  Description: Never miss an enquiry again! Save all Contact Form 7 submissions in your database.
5
+ Version: 1.7
6
  Author: Jason Green
7
  License: GPLv3
8
  Domain Path: /languages
readme.txt CHANGED
@@ -3,8 +3,9 @@ Contributors: jasongreen
3
  Tags: contact form 7, save contact form, submissions, contact form db, cf7, wpcf7, contact form storage, contact form seven, contact form 7 db, export contact form
4
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=SNHXWSXSPYATE
5
  Requires at least: 3.0.1
6
- Tested up to: 5.2.3
7
- Stable tag: 1.6.4
 
8
  License: GPLv3
9
 
10
  Never miss an enquiry again! Save & Export your Contact Form 7 submissions.
@@ -42,6 +43,10 @@ None yet
42
 
43
  == Changelog ==
44
 
 
 
 
 
45
  = 1.6.4 =
46
  * Added security fix to escape user submitted data
47
 
3
  Tags: contact form 7, save contact form, submissions, contact form db, cf7, wpcf7, contact form storage, contact form seven, contact form 7 db, export contact form
4
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=SNHXWSXSPYATE
5
  Requires at least: 3.0.1
6
+ Tested up to: 5.7
7
+ Stable tag: 1.7
8
+ Requires PHP: 5.6
9
  License: GPLv3
10
 
11
  Never miss an enquiry again! Save & Export your Contact Form 7 submissions.
43
 
44
  == Changelog ==
45
 
46
+ = 1.7 =
47
+ * Security fixes
48
+ * Fixed image upload with contact form 7 code change
49
+
50
  = 1.6.4 =
51
  * Added security fix to escape user submitted data
52