Advanced Contact form 7 DB - Version 1.8.9

Version Description

Download this release

Release Info

Developer vsourz1td
Plugin Icon 128x128 Advanced Contact form 7 DB
Version 1.8.9
Comparing to
See all releases

Code changes from version 1.8.8 to 1.8.9

README.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: vsourz1td
3
  Tags: contact form 7 db, contact form db, advanced cf7 db, contact form 7 database, contact form db, contact form 7, save form data, save contact form, save cf7, database, cf7db, save-contact-form, Save-Forms-Data, import-cf7, export-contact-data, view-cf7-entry
4
  Requires at least: 4.0
5
  Tested up to: 6.0
6
- Stable tag: 1.8.8
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -192,6 +192,9 @@ return $contact_form_ids;
192
 
193
  == Changelog ==
194
 
 
 
 
195
  = 1.8.8 =
196
  * We have upgraded with Security patches
197
 
3
  Tags: contact form 7 db, contact form db, advanced cf7 db, contact form 7 database, contact form db, contact form 7, save form data, save contact form, save cf7, database, cf7db, save-contact-form, Save-Forms-Data, import-cf7, export-contact-data, view-cf7-entry
4
  Requires at least: 4.0
5
  Tested up to: 6.0
6
+ Stable tag: 1.8.9
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
192
 
193
  == Changelog ==
194
 
195
+ = 1.9 =
196
+ * We have upgraded with Security patches
197
+
198
  = 1.8.8 =
199
  * We have upgraded with Security patches
200
 
admin/class-advanced-cf7-db-admin.php CHANGED
@@ -805,7 +805,7 @@ class Advanced_Cf7_Db_Admin {
805
  //Get field type information here
806
  if(isset($_POST['arr_field_type']) && !empty($_POST['arr_field_type'])){
807
  //Decode Json format string here
808
- $arr_field_type = json_decode(wp_unslash($_POST['arr_field_type']),true);
809
  }
810
 
811
  //Define option field type array
@@ -880,7 +880,8 @@ class Advanced_Cf7_Db_Admin {
880
  die('Security check');
881
  }
882
  //Get Delete row ID information
883
- $del_id = implode(',', array_map('intval',$_POST['del_id']));
 
884
  //Get Form ID
885
  $fid = intval(sanitize_text_field($_POST['fid']));
886
 
@@ -942,6 +943,7 @@ class Advanced_Cf7_Db_Admin {
942
  $fid = (int)sanitize_text_field($_POST['fid']);
943
 
944
  //Get export id related information
 
945
  $ids_export = ((isset($_POST['del_id']) && !empty($_POST['del_id'])) ? implode(',', array_map('intval',$_POST['del_id'])) : '');
946
  ///Get export type related information
947
  $type = sanitize_text_field($_POST['vsz-cf7-export']);
@@ -1276,7 +1278,7 @@ class Advanced_Cf7_Db_Admin {
1276
  $newfilename = wp_unique_filename($temp_dir_upload, $file_basename.$file_ext);
1277
 
1278
  if(move_uploaded_file($_FILES["image"]["tmp_name"], $temp_dir_upload. '/' .$newfilename)){
1279
- $file_url = $upload_dir['baseurl'] . '/' . $acf7db_upload_folder.'/'.$newfilename;
1280
 
1281
  $res = $wpdb->update(VSZ_CF7_DATA_ENTRY_TABLE_NAME, array("value" => $file_url), array("data_id" => $rid, "cf7_id" => $fid, "name" => $field));
1282
  if($res !== false){
805
  //Get field type information here
806
  if(isset($_POST['arr_field_type']) && !empty($_POST['arr_field_type'])){
807
  //Decode Json format string here
808
+ $arr_field_type = json_decode(wp_unslash(sanitize_textarea_field($_POST['arr_field_type'])),true);
809
  }
810
 
811
  //Define option field type array
880
  die('Security check');
881
  }
882
  //Get Delete row ID information
883
+ $del_id = array_map('sanitize_text_field',$_POST['del_id']);
884
+ $del_id = implode(',', array_map('intval',$del_id));
885
  //Get Form ID
886
  $fid = intval(sanitize_text_field($_POST['fid']));
887
 
943
  $fid = (int)sanitize_text_field($_POST['fid']);
944
 
945
  //Get export id related information
946
+ $ids_export = ((isset($_POST['del_id']) && !empty($_POST['del_id'])) ? implode(',', array_map('sanitize_text_field',$_POST['del_id'])) : '');
947
  $ids_export = ((isset($_POST['del_id']) && !empty($_POST['del_id'])) ? implode(',', array_map('intval',$_POST['del_id'])) : '');
948
  ///Get export type related information
949
  $type = sanitize_text_field($_POST['vsz-cf7-export']);
1278
  $newfilename = wp_unique_filename($temp_dir_upload, $file_basename.$file_ext);
1279
 
1280
  if(move_uploaded_file($_FILES["image"]["tmp_name"], $temp_dir_upload. '/' .$newfilename)){
1281
+ $file_url = esc_url_raw($upload_dir['baseurl'] . '/' . $acf7db_upload_folder.'/'.$newfilename);
1282
 
1283
  $res = $wpdb->update(VSZ_CF7_DATA_ENTRY_TABLE_NAME, array("value" => $file_url), array("data_id" => $rid, "cf7_id" => $fid, "name" => $field));
1284
  if($res !== false){
admin/partials/contact_form_listing.php CHANGED
@@ -267,8 +267,8 @@ else{
267
  ?><div class="span12">
268
  <div class="date-filter from-to" style="display:block;">
269
  <div class="from-to-date-search">
270
- <input type="text" name="start_date" id="start_date" placeholder="From" value="<?php print isset($_POST['start_date']) ? esc_attr($_POST['start_date']) : '';?>" class="input-cf-date">
271
- <input type="text" name="end_date" id="end_date" placeholder="To" value="<?php print isset($_POST['end_date']) ? esc_attr($_POST['end_date']) : '';?>" class="input-cf-date" >
272
  <input type="button" name="search_date" id="search_date" value="<?php esc_html_e('Search By Date',VSZ_CF7_TEXT_DOMAIN); ?>" title="<?php esc_html_e('Search By Date',VSZ_CF7_TEXT_DOMAIN); ?>" class="button action" >
273
  </div>
274
  <div class="type-something"><?php
267
  ?><div class="span12">
268
  <div class="date-filter from-to" style="display:block;">
269
  <div class="from-to-date-search">
270
+ <input type="text" name="start_date" id="start_date" placeholder="From" value="<?php print isset($_POST['start_date']) ? esc_attr(sanitize_text_field($_POST['start_date'])) : '';?>" class="input-cf-date">
271
+ <input type="text" name="end_date" id="end_date" placeholder="To" value="<?php print isset($_POST['end_date']) ? esc_attr(sanitize_text_field($_POST['end_date'])) : '';?>" class="input-cf-date" >
272
  <input type="button" name="search_date" id="search_date" value="<?php esc_html_e('Search By Date',VSZ_CF7_TEXT_DOMAIN); ?>" title="<?php esc_html_e('Search By Date',VSZ_CF7_TEXT_DOMAIN); ?>" class="button action" >
273
  </div>
274
  <div class="type-something"><?php
advanced-cf7-db.php CHANGED
@@ -9,7 +9,7 @@
9
  * Plugin Name: Advanced CF7 DB
10
  * Plugin URI: https://wordpress.org/plugins/advanced-cf7-db/
11
  * Description: Save all contact form 7 submitted data to the database, View, Export, ordering, Change field labels, Import data using CSV very easily.
12
- * Version: 1.8.8
13
  * Author: Vsourz Digital
14
  * Author URI: https://www.vsourz.com
15
  * License: GPL-2.0+
@@ -23,7 +23,7 @@ if ( ! defined( 'WPINC' ) ) {
23
  die;
24
  }
25
  global $vsz_cf7db_current_version;
26
- $vsz_cf7db_current_version = '1.8.8';
27
  /**
28
  * Defining all the table names and setting their prefix here
29
  */
9
  * Plugin Name: Advanced CF7 DB
10
  * Plugin URI: https://wordpress.org/plugins/advanced-cf7-db/
11
  * Description: Save all contact form 7 submitted data to the database, View, Export, ordering, Change field labels, Import data using CSV very easily.
12
+ * Version: 1.8.9
13
  * Author: Vsourz Digital
14
  * Author URI: https://www.vsourz.com
15
  * License: GPL-2.0+
23
  die;
24
  }
25
  global $vsz_cf7db_current_version;
26
+ $vsz_cf7db_current_version = '1.8.9';
27
  /**
28
  * Defining all the table names and setting their prefix here
29
  */
includes/class-advanced-cf7-db.php CHANGED
@@ -69,7 +69,7 @@ class Advanced_Cf7_Db {
69
  public function __construct() {
70
 
71
  $this->plugin_name = 'advanced-cf7-db';
72
- $this->version = '1.8.8';
73
 
74
  $this->load_dependencies();
75
  $this->set_locale();
69
  public function __construct() {
70
 
71
  $this->plugin_name = 'advanced-cf7-db';
72
+ $this->version = '1.9';
73
 
74
  $this->load_dependencies();
75
  $this->set_locale();
includes/vsz-cf7-db-function.php CHANGED
@@ -113,7 +113,16 @@ function vsz_cf7_add_extra_fields($cf7){
113
 
114
  if(!defined('vsz_cf7_display_ip')){
115
  //Get submitted ip address
116
- $cf7->posted_data['submit_ip'] = (isset($_SERVER['X_FORWARDED_FOR'])) ? $_SERVER['X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR'];
 
 
 
 
 
 
 
 
 
117
  }
118
  return $cf7;
119
  }
@@ -152,7 +161,7 @@ if (!function_exists('vsz_cf7_modify_form_before_insert_in_cf7_vdata_entry')) {
152
  //Copy file information in destination variable
153
  if (@copy($val, $dst_file)){
154
  //Setup customize file information in array
155
- $cf7->posted_data[$k] = $upload_dir['baseurl'] . '/' . $cf7d_upload_folder . '/' . $file_name;
156
  }
157
  }
158
  }//Close foreach
113
 
114
  if(!defined('vsz_cf7_display_ip')){
115
  //Get submitted ip address
116
+ $ip_address = (isset($_SERVER['X_FORWARDED_FOR']) && !empty(rest_is_ip_address($_SERVER['X_FORWARDED_FOR']))) ? $_SERVER['X_FORWARDED_FOR'] : "";
117
+
118
+ if(empty($ip_address)){
119
+ $ip_address = (isset($_SERVER['REMOTE_ADDR']) && !empty(rest_is_ip_address($_SERVER['REMOTE_ADDR']))) ? $_SERVER['REMOTE_ADDR'] : "";
120
+ }
121
+
122
+ if(!empty($ip_address)){
123
+ $cf7->posted_data['submit_ip'] = $ip_address;
124
+ }
125
+ //$cf7->posted_data['submit_ip'] = (isset($_SERVER['X_FORWARDED_FOR']) && !empty(rest_is_ip_address($_SERVER['X_FORWARDED_FOR']))) ? $_SERVER['X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR'];
126
  }
127
  return $cf7;
128
  }
161
  //Copy file information in destination variable
162
  if (@copy($val, $dst_file)){
163
  //Setup customize file information in array
164
+ $cf7->posted_data[$k] = esc_url_raw($upload_dir['baseurl'] . '/' . $cf7d_upload_folder . '/' . $file_name);
165
  }
166
  }
167
  }//Close foreach