Contact Form Submissions - Version 1.2.1

Version Description

  • Security fix: Fixed posts from being loaded when not logged in. Thanks to aurepons for discovering the issue.
Download this release

Release Info

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

Code changes from version 1.2 to 1.2.1

Files changed (3) hide show
  1. Submissions.php +20 -2
  2. contact-form-submissions.php +1 -1
  3. readme.txt +4 -1
Submissions.php CHANGED
@@ -5,6 +5,8 @@ class WPCF7Submissions {
5
  add_action('init', array($this, 'post_type') );
6
 
7
  add_filter('wpcf7_mail_components', array($this, 'submission'), 999, 3);
 
 
8
  }
9
 
10
  function post_type() {
@@ -33,9 +35,10 @@ class WPCF7Submissions {
33
  'can_export' => true,
34
  'has_archive' => false,
35
  'exclude_from_search' => true,
36
- 'publicly_queryable' => true,
37
  'rewrite' => false,
38
  'capability_type' => 'page',
 
39
  'capabilities' => array(
40
  'create_posts' => false
41
  ),
@@ -106,4 +109,19 @@ class WPCF7Submissions {
106
 
107
  return $post_id;
108
  }
109
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5
  add_action('init', array($this, 'post_type') );
6
 
7
  add_filter('wpcf7_mail_components', array($this, 'submission'), 999, 3);
8
+
9
+ add_action('pre_get_posts', array($this, 'disable_feed'));
10
  }
11
 
12
  function post_type() {
35
  'can_export' => true,
36
  'has_archive' => false,
37
  'exclude_from_search' => true,
38
+ 'publicly_queryable' => false,
39
  'rewrite' => false,
40
  'capability_type' => 'page',
41
+ 'query_var' => false,
42
  'capabilities' => array(
43
  'create_posts' => false
44
  ),
109
 
110
  return $post_id;
111
  }
112
+
113
+ private function disable_feed($query) {
114
+ if( !$query->is_feed || !$query->is_main_query() )
115
+ return query;
116
+
117
+ $exclude = 'wpcf7s';
118
+ $post_types = $query->get('post_type');
119
+
120
+ if (($key = array_search($exclude, $post_types)) !== false)
121
+ unset($post_types[$key]);
122
+
123
+ $query->set( 'post_type', $post_types );
124
+
125
+ return query;
126
+ }
127
+ }
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.2
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.2.1
6
  Author: Jason Green
7
  License: GPLv3
8
  Domain Path: /languages
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: contact form 7, save contact form, submissions, contact form db, cf7, wpcf
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.3.1
7
- Stable tag: 1.2
8
  License: GPLv3
9
 
10
  Never miss an enquiry again! Save all Contact Form 7 submissions in your database.
@@ -35,6 +35,9 @@ None yet
35
 
36
  == Changelog ==
37
 
 
 
 
38
  = 1.2 =
39
  * Added screenshots
40
  * Added support for large mail text
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.3.1
7
+ Stable tag: 1.2.1
8
  License: GPLv3
9
 
10
  Never miss an enquiry again! Save all Contact Form 7 submissions in your database.
35
 
36
  == Changelog ==
37
 
38
+ = 1.2.1 =
39
+ * Security fix: Fixed posts from being loaded when not logged in. Thanks to [aurepons](https://wordpress.org/support/profile/aurepons) for discovering the issue.
40
+
41
  = 1.2 =
42
  * Added screenshots
43
  * Added support for large mail text