MW WP Form - Version 0.9.10

Version Description

  • Bug fix: mwform_admin_mail_mwform_auto_mail_
  • Bug fix: From Ver0.9.4
  • Bug fix: Akismet EmailAkismet URL
  • Cahged : $_POST WP Query
Download this release

Release Info

Developer inc2734
Plugin Icon wp plugin MW WP Form
Version 0.9.10
Comparing to
See all releases

Code changes from version 0.9.9 to 0.9.10

mw-wp-form.php CHANGED
@@ -3,11 +3,11 @@
3
  * Plugin Name: MW WP Form
4
  * Plugin URI: http://2inc.org/blog/category/products/wordpress_plugins/mw-wp-form/
5
  * Description: MW WP Form can create mail form with a confirmation screen.
6
- * Version: 0.9.9
7
  * Author: Takashi Kitajima
8
  * Author URI: http://2inc.org
9
  * Created: September 25, 2012
10
- * Modified: September 5, 2013
11
  * Text Domain: mw-wp-form
12
  * Domain Path: /languages/
13
  * License: GPL2
@@ -59,8 +59,8 @@ class mw_wp_form {
59
  'querystring' => null,
60
  'usedb' => null,
61
  'akismet_author' => '',
62
- 'author_email' => '',
63
- 'author_url' => '',
64
  'complete_message' => '',
65
  'input_url' => '',
66
  'confirmation_url' => '',
@@ -110,6 +110,23 @@ class mw_wp_form {
110
  include_once( plugin_dir_path( __FILE__ ) . 'system/mw_validation.php' );
111
  add_action( 'wp', array( $this, 'main' ) );
112
  add_action( 'wp_print_styles', array( $this, 'original_style' ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
113
  }
114
 
115
  /**
@@ -495,7 +512,7 @@ class mw_wp_form {
495
  $Mail = apply_filters( $filter_name, $Mail, $this->Data->getValues() );
496
 
497
  if ( $this->options_by_formkey && !empty( $Mail ) ) {
498
- $filter_name = 'mwform_auto_mail_' . $this->key;
499
  $Mail = apply_filters( $filter_name, $Mail, $this->Data->getValues() );
500
  $Mail->send();
501
 
@@ -525,7 +542,7 @@ class mw_wp_form {
525
  // 自動返信メールからは添付ファイルを削除
526
  $Mail->attachments = array();
527
 
528
- $filter_name = 'mwform_admin_mail_' . $this->key;
529
  $Mail = apply_filters( $filter_name, $Mail, $this->Data->getValues() );
530
  $Mail->send();
531
  }
3
  * Plugin Name: MW WP Form
4
  * Plugin URI: http://2inc.org/blog/category/products/wordpress_plugins/mw-wp-form/
5
  * Description: MW WP Form can create mail form with a confirmation screen.
6
+ * Version: 0.9.10
7
  * Author: Takashi Kitajima
8
  * Author URI: http://2inc.org
9
  * Created: September 25, 2012
10
+ * Modified: September 13, 2013
11
  * Text Domain: mw-wp-form
12
  * Domain Path: /languages/
13
  * License: GPL2
59
  'querystring' => null,
60
  'usedb' => null,
61
  'akismet_author' => '',
62
+ 'akismet_author_email' => '',
63
+ 'akismet_author_url' => '',
64
  'complete_message' => '',
65
  'input_url' => '',
66
  'confirmation_url' => '',
110
  include_once( plugin_dir_path( __FILE__ ) . 'system/mw_validation.php' );
111
  add_action( 'wp', array( $this, 'main' ) );
112
  add_action( 'wp_print_styles', array( $this, 'original_style' ) );
113
+ add_action( 'parse_request', array( $this, 'remote_query_vars_from_post' ) );
114
+ }
115
+
116
+ /**
117
+ * remote_query_vars_from_post
118
+ * WordPressへのリクエストに含まれている、$_POSTの値を削除
119
+ */
120
+ public function remote_query_vars_from_post( $query ) {
121
+ if ( strtolower( $_SERVER['REQUEST_METHOD'] ) === 'post' && isset( $_POST['token'] ) ) {
122
+ foreach ( $_POST as $key => $value ) {
123
+ if ( $key == 'token' )
124
+ continue;
125
+ if ( isset( $query->query_vars[$key] ) && $query->query_vars[$key] === $value && !empty( $value ) ) {
126
+ $query->query_vars[$key] = '';
127
+ }
128
+ }
129
+ }
130
  }
131
 
132
  /**
512
  $Mail = apply_filters( $filter_name, $Mail, $this->Data->getValues() );
513
 
514
  if ( $this->options_by_formkey && !empty( $Mail ) ) {
515
+ $filter_name = 'mwform_admin_mail_' . $this->key;
516
  $Mail = apply_filters( $filter_name, $Mail, $this->Data->getValues() );
517
  $Mail->send();
518
 
542
  // 自動返信メールからは添付ファイルを削除
543
  $Mail->attachments = array();
544
 
545
+ $filter_name = 'mwform_auto_mail_' . $this->key;
546
  $Mail = apply_filters( $filter_name, $Mail, $this->Data->getValues() );
547
  $Mail->send();
548
  }
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link:
4
  Tags: plugin, form, confirm, preview
5
  Requires at least: 3.4
6
  Tested up to: 3.5
7
- Stable tag: 0.9.9
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -37,6 +37,12 @@ http://2inc.org/blog/category/products/wordpress_plugins/mw-wp-form/
37
 
38
  == Changelog ==
39
 
 
 
 
 
 
 
40
  = 0.9.9 =
41
  * Added : mwform_csv_button_識別子 フィルターフック
42
  * Bug fix: name属性が未指定のとき、MW_Form::getZipValue, MW_Form::getCheckedValue でエラーがでるバグ修正
4
  Tags: plugin, form, confirm, preview
5
  Requires at least: 3.4
6
  Tested up to: 3.5
7
+ Stable tag: 0.9.10
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
37
 
38
  == Changelog ==
39
 
40
+ = 0.9.10 =
41
+ * Bug fix: mwform_admin_mail_識別子、mwform_auto_mail_識別子フィルターフックの定義位置が逆だったのを修正
42
+ * Bug fix: 添付ファイルが添付されないバグを修正(From Ver0.9.4)
43
+ * Bug fix: Akismet Email、Akismet URL の設定が正しく行えなかったのを修正
44
+ * Cahged : フォーム送信時は $_POST を WP Query に含めない
45
+
46
  = 0.9.9 =
47
  * Added : mwform_csv_button_識別子 フィルターフック
48
  * Bug fix: name属性が未指定のとき、MW_Form::getZipValue, MW_Form::getCheckedValue でエラーがでるバグ修正
system/mw_mail.php CHANGED
@@ -3,11 +3,11 @@
3
  * Name: MW Mail
4
  * URI: http://2inc.org
5
  * Description: メールクラス
6
- * Version: 1.3.1
7
  * Author: Takashi Kitajima
8
  * Author URI: http://2inc.org
9
  * Created: July 20, 2012
10
- * Modified: August 6, 2013
11
  * License: GPL2
12
  *
13
  * Copyright 2013 Takashi Kitajima (email : inc@2inc.org)
@@ -50,7 +50,8 @@ class MW_Mail {
50
  $to = explode( ',', $this->to );
51
  if ( isset( $to[0] ) ) {
52
  $to = trim( $to[0] );
53
- wp_mail( $to, $subject, $body, $this->attachments );
 
54
  remove_action( 'phpmailer_init', array( $this, 'set_return_path' ) );
55
  remove_filter( 'wp_mail_from', array( $this, 'set_mail_from' ) );
56
  remove_filter( 'wp_mail_from_name', array( $this, 'set_mail_from_name' ) );
3
  * Name: MW Mail
4
  * URI: http://2inc.org
5
  * Description: メールクラス
6
+ * Version: 1.3.2
7
  * Author: Takashi Kitajima
8
  * Author URI: http://2inc.org
9
  * Created: July 20, 2012
10
+ * Modified: September 13, 2013
11
  * License: GPL2
12
  *
13
  * Copyright 2013 Takashi Kitajima (email : inc@2inc.org)
50
  $to = explode( ',', $this->to );
51
  if ( isset( $to[0] ) ) {
52
  $to = trim( $to[0] );
53
+ $header = '';
54
+ wp_mail( $to, $subject, $body, $header, $this->attachments );
55
  remove_action( 'phpmailer_init', array( $this, 'set_return_path' ) );
56
  remove_filter( 'wp_mail_from', array( $this, 'set_mail_from' ) );
57
  remove_filter( 'wp_mail_from_name', array( $this, 'set_mail_from_name' ) );
system/mw_wp_form_admin_page.php CHANGED
@@ -473,11 +473,11 @@ class MW_WP_Form_Admin_Page {
473
  </tr>
474
  <tr>
475
  <td>email</td>
476
- <td><input type="text" name="<?php echo esc_attr( MWF_Config::NAME ); ?>[author_email]" value="<?php echo esc_attr( $this->get_post_data( 'akismet_author_email' ) ); ?>" /></td>
477
  </tr>
478
  <tr>
479
  <td>url</td>
480
- <td><input type="text" name="<?php echo esc_attr( MWF_Config::NAME ); ?>[author_url]" value="<?php echo esc_attr( $this->get_post_data( 'akismet_author_url' ) ); ?>" /></td>
481
  </tr>
482
  </table>
483
  <span class="mwf_note"><?php _e( 'Input the key to use Akismet.', MWF_Config::DOMAIN ); ?></span>
473
  </tr>
474
  <tr>
475
  <td>email</td>
476
+ <td><input type="text" name="<?php echo esc_attr( MWF_Config::NAME ); ?>[akismet_author_email]" value="<?php echo esc_attr( $this->get_post_data( 'akismet_author_email' ) ); ?>" /></td>
477
  </tr>
478
  <tr>
479
  <td>url</td>
480
+ <td><input type="text" name="<?php echo esc_attr( MWF_Config::NAME ); ?>[akismet_author_url]" value="<?php echo esc_attr( $this->get_post_data( 'akismet_author_url' ) ); ?>" /></td>
481
  </tr>
482
  </table>
483
  <span class="mwf_note"><?php _e( 'Input the key to use Akismet.', MWF_Config::DOMAIN ); ?></span>