Contact Form Submissions - Version 1.6.3

Version Description

  • Added check for mb_convert_encoding. Updating query to add constant as prefix.
Download this release

Release Info

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

Code changes from version 1.6.2 to 1.6.3

Files changed (2) hide show
  1. Admin.php +10 -3
  2. readme.txt +5 -2
Admin.php CHANGED
@@ -414,7 +414,7 @@ class WPCF7SAdmin
414
 
415
  $post_id = $wpdb->get_var("SELECT post_id FROM $wpdb->postmeta WHERE meta_key = 'form_id' AND meta_value = $form_id LIMIT 1;");
416
 
417
- $columns = $wpdb->get_col("SELECT meta_key FROM wp_postmeta WHERE post_id = $post_id AND meta_key LIKE '%wpcf7s_%' GROUP BY meta_key");
418
 
419
  return $columns;
420
  }
@@ -481,7 +481,10 @@ class WPCF7SAdmin
481
  }
482
 
483
  $value = sanitize_text_field($value);
484
- $values[$key] = mb_convert_encoding($value, $charset);
 
 
 
485
 
486
  // if we havent already stored this column, save it now
487
  if(!in_array($key, $columns)){
@@ -502,7 +505,11 @@ class WPCF7SAdmin
502
  $files[] = "$upload_dir/wpcf7-submissions/$post_id/$singleFile";
503
  }
504
  }
505
- $values[$keyFile] = mb_convert_encoding(implode(',', $files), $charset);
 
 
 
 
506
 
507
  // if we havent already stored this column, save it now
508
  if(!in_array($keyFile, $columns)){
414
 
415
  $post_id = $wpdb->get_var("SELECT post_id FROM $wpdb->postmeta WHERE meta_key = 'form_id' AND meta_value = $form_id LIMIT 1;");
416
 
417
+ $columns = $wpdb->get_col("SELECT meta_key FROM $wpdb->postmeta WHERE post_id = $post_id AND meta_key LIKE '%wpcf7s_%' GROUP BY meta_key");
418
 
419
  return $columns;
420
  }
481
  }
482
 
483
  $value = sanitize_text_field($value);
484
+ if(function_exists('mb_convert_encoding')){
485
+ $value = mb_convert_encoding($value, $charset);
486
+ }
487
+ $values[$key] = $value;
488
 
489
  // if we havent already stored this column, save it now
490
  if(!in_array($key, $columns)){
505
  $files[] = "$upload_dir/wpcf7-submissions/$post_id/$singleFile";
506
  }
507
  }
508
+ $files = implode(',', $files);
509
+ if(function_exists('mb_convert_encoding')){
510
+ $value = mb_convert_encoding($files, $charset);
511
+ }
512
+ $values[$keyFile] = $files;
513
 
514
  // if we havent already stored this column, save it now
515
  if(!in_array($keyFile, $columns)){
readme.txt CHANGED
@@ -3,8 +3,8 @@ 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: 4.8.1
7
- Stable tag: 1.6.2
8
  License: GPLv3
9
 
10
  Never miss an enquiry again! Save & Export your Contact Form 7 submissions.
@@ -42,6 +42,9 @@ None yet
42
 
43
  == Changelog ==
44
 
 
 
 
45
  = 1.6.2 =
46
  * Fixed the problem with character encoding when exporting. Thanks to [archie22is](https://wordpress.org/support/users/archie22is/) for the fix.
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.2.3
7
+ Stable tag: 1.6.3
8
  License: GPLv3
9
 
10
  Never miss an enquiry again! Save & Export your Contact Form 7 submissions.
42
 
43
  == Changelog ==
44
 
45
+ = 1.6.3 =
46
+ * Added check for mb_convert_encoding. Updating query to add constant as prefix.
47
+
48
  = 1.6.2 =
49
  * Fixed the problem with character encoding when exporting. Thanks to [archie22is](https://wordpress.org/support/users/archie22is/) for the fix.
50