Plugin Directory

Changeset 1797124


Ignore:
Timestamp:
01/04/2018 04:53:00 PM (8 years ago)
Author:
mediaburst
Message:

Fix Form Save Bug

Location:
contact-form-7-sms-addon
Files:
9 edited
10 copied

Legend:

Unmodified
Added
Removed
  • contact-form-7-sms-addon/tags/2.4.3/contact-form-7-sms-addon.php

    r1785297 r1797124  
    44Plugin URI: http://wordpress.org/extend/plugins/contact-form-7-sms-addon/
    55Description: Send SMS notifications when somebody submits your contact form
    6 Version: 2.4.2
     6Version: 2.4.3
    77Author: Mediaburst
    88Author URI: http://www.mediaburst.co.uk/
  • contact-form-7-sms-addon/tags/2.4.3/lib/clockwork/class-WordPressClockwork.php

    r600594 r1797124  
    99*
    1010* @package     Clockwork
    11 * @subpackage  WordPressClockwork       
     11* @subpackage  WordPressClockwork
    1212* @since       1.0
    1313*/
     
    2929   */
    3030  const API_GET_KEY_METHOD = 'get_key';
    31  
     31
    3232  /**
    3333   * Mapping of country dialing codes to ISO codes
     
    301301    'ZW' => '263',
    302302  );
    303  
    304   /** 
     303
     304  /**
    305305   * Legacy username
    306    * 
     306   *
    307307   * @var string
    308308   */
    309309  private $username;
    310  
    311   /** 
     310
     311  /**
    312312   * Legacy password
    313    * 
     313   *
    314314   * @var string
    315315   */
    316316  public $password;
    317  
     317
    318318  /**
    319319   * Create a new instance of the Clockwork wrapper
    320320   *
    321    * Also supports passing a username and a password as first and second parameter, but ONLY when 
     321   * Also supports passing a username and a password as first and second parameter, but ONLY when
    322322   * used in WordPressClockwork for the purposes of converting to an API key.
    323323   *
     
    334334    }
    335335  }
    336  
     336
    337337  public function createAPIKey( $name = 'WordPress API Key' ) {
    338338    // Create XML doc for request
     
    355355    $err_no = null;
    356356    $err_desc = null;
    357          
     357
    358358    foreach( $resp_doc->documentElement->childNodes as $doc_child ) {
    359359      switch( $doc_child->nodeName ) {
     
    371371      }
    372372    }
    373    
     373
    374374    if( isset( $err_no ) ) {
    375375      throw new ClockworkException( $err_desc, $err_no );
    376376    }
    377    
     377
    378378    $this->key = $key;
    379379    return $key;
    380380  }
    381  
     381
    382382  /**
    383383  * Check if the WordPress HTTP API can support SSL
     
    400400    'body'    => $data,
    401401    'headers' => array( 'Content-Type' => 'text/xml' ),
     402    'user-agent' => 'Clockwork Wordpress-ContactForm7 Wrapper',
    402403    'timeout' => 10, // Seconds
    403404    );
    404    
     405
    405406    // Check whether WordPress should veryify the SSL certificate
    406407    if( stristr( $url, 'https://' ) ) {
     
    419420  * Verify SSL conectivity to the remote host
    420421  *
    421   * If the request fails store a flag so that we 
     422  * If the request fails store a flag so that we
    422423  * don't need to do the check again
    423424  */
     
    427428      $opt = array();
    428429    }
    429    
     430
    430431    if( !array_key_exists( 'sslverify', $opt ) ) {
    431432      $args = array(
    432433        'timeout' => 10 // Seconds
    433434      );
    434      
     435
    435436      $result = wp_remote_post( $url, $args );
    436      
     437
    437438      if( is_wp_error( $result ) ) {
    438439        $opt['sslverify'] = false;
     
    440441        $opt['sslverify'] = true;
    441442      }
    442      
     443
    443444      update_option( self::SSL_OPTIONS_KEY, $opt );
    444445    }
  • contact-form-7-sms-addon/tags/2.4.3/main.php

    r1781426 r1797124  
    138138   * @author James Inman
    139139   */
    140   public function save_form( $form ) {
    141     update_option( 'wpcf7_sms_' . (method_exists($form, 'id') ? $form->id() : $form->id), sanitize_text_field($_POST['wpcf7-sms']) );
    142   }
     140   public function save_form( $form ) {
     141       $id = method_exists($form, 'id') ? $form->id() : $form->id;
     142       $form = $_POST['wpcf7-sms'];
     143
     144       $form["phone"] = sanitize_text_field(stripslashes($form["phone"]));
     145       $form["message"] = sanitize_textarea_field(stripslashes($form["message"]));
     146
     147       update_option('wpcf7_sms_' . $id, $form);
     148   }
    143149
    144150  /**
  • contact-form-7-sms-addon/tags/2.4.3/readme.txt

    r1785297 r1797124  
    77Requires at least: 3.0.0
    88Tested up to: 4.2.2
    9 Stable tag: 2.4.2
     9Stable tag: 2.4.3
    1010
    1111Works with the Contact Form 7 plugin to send SMS notifications when somebody
     
    6767
    6868== Changelog ==
     69
     70= 2.4.3 =
     71* Remove old branding
     72* Fix form save bug
    6973
    7074= 2.4.2 =
  • contact-form-7-sms-addon/trunk/contact-form-7-sms-addon.php

    r1785297 r1797124  
    44Plugin URI: http://wordpress.org/extend/plugins/contact-form-7-sms-addon/
    55Description: Send SMS notifications when somebody submits your contact form
    6 Version: 2.4.2
     6Version: 2.4.3
    77Author: Mediaburst
    88Author URI: http://www.mediaburst.co.uk/
  • contact-form-7-sms-addon/trunk/lib/clockwork/class-WordPressClockwork.php

    r600594 r1797124  
    99*
    1010* @package     Clockwork
    11 * @subpackage  WordPressClockwork       
     11* @subpackage  WordPressClockwork
    1212* @since       1.0
    1313*/
     
    2929   */
    3030  const API_GET_KEY_METHOD = 'get_key';
    31  
     31
    3232  /**
    3333   * Mapping of country dialing codes to ISO codes
     
    301301    'ZW' => '263',
    302302  );
    303  
    304   /** 
     303
     304  /**
    305305   * Legacy username
    306    * 
     306   *
    307307   * @var string
    308308   */
    309309  private $username;
    310  
    311   /** 
     310
     311  /**
    312312   * Legacy password
    313    * 
     313   *
    314314   * @var string
    315315   */
    316316  public $password;
    317  
     317
    318318  /**
    319319   * Create a new instance of the Clockwork wrapper
    320320   *
    321    * Also supports passing a username and a password as first and second parameter, but ONLY when 
     321   * Also supports passing a username and a password as first and second parameter, but ONLY when
    322322   * used in WordPressClockwork for the purposes of converting to an API key.
    323323   *
     
    334334    }
    335335  }
    336  
     336
    337337  public function createAPIKey( $name = 'WordPress API Key' ) {
    338338    // Create XML doc for request
     
    355355    $err_no = null;
    356356    $err_desc = null;
    357          
     357
    358358    foreach( $resp_doc->documentElement->childNodes as $doc_child ) {
    359359      switch( $doc_child->nodeName ) {
     
    371371      }
    372372    }
    373    
     373
    374374    if( isset( $err_no ) ) {
    375375      throw new ClockworkException( $err_desc, $err_no );
    376376    }
    377    
     377
    378378    $this->key = $key;
    379379    return $key;
    380380  }
    381  
     381
    382382  /**
    383383  * Check if the WordPress HTTP API can support SSL
     
    400400    'body'    => $data,
    401401    'headers' => array( 'Content-Type' => 'text/xml' ),
     402    'user-agent' => 'Clockwork Wordpress-ContactForm7 Wrapper',
    402403    'timeout' => 10, // Seconds
    403404    );
    404    
     405
    405406    // Check whether WordPress should veryify the SSL certificate
    406407    if( stristr( $url, 'https://' ) ) {
     
    419420  * Verify SSL conectivity to the remote host
    420421  *
    421   * If the request fails store a flag so that we 
     422  * If the request fails store a flag so that we
    422423  * don't need to do the check again
    423424  */
     
    427428      $opt = array();
    428429    }
    429    
     430
    430431    if( !array_key_exists( 'sslverify', $opt ) ) {
    431432      $args = array(
    432433        'timeout' => 10 // Seconds
    433434      );
    434      
     435
    435436      $result = wp_remote_post( $url, $args );
    436      
     437
    437438      if( is_wp_error( $result ) ) {
    438439        $opt['sslverify'] = false;
     
    440441        $opt['sslverify'] = true;
    441442      }
    442      
     443
    443444      update_option( self::SSL_OPTIONS_KEY, $opt );
    444445    }
  • contact-form-7-sms-addon/trunk/main.php

    r1781426 r1797124  
    138138   * @author James Inman
    139139   */
    140   public function save_form( $form ) {
    141     update_option( 'wpcf7_sms_' . (method_exists($form, 'id') ? $form->id() : $form->id), sanitize_text_field($_POST['wpcf7-sms']) );
    142   }
     140   public function save_form( $form ) {
     141       $id = method_exists($form, 'id') ? $form->id() : $form->id;
     142       $form = $_POST['wpcf7-sms'];
     143
     144       $form["phone"] = sanitize_text_field(stripslashes($form["phone"]));
     145       $form["message"] = sanitize_textarea_field(stripslashes($form["message"]));
     146
     147       update_option('wpcf7_sms_' . $id, $form);
     148   }
    143149
    144150  /**
  • contact-form-7-sms-addon/trunk/readme.txt

    r1785297 r1797124  
    77Requires at least: 3.0.0
    88Tested up to: 4.2.2
    9 Stable tag: 2.4.2
     9Stable tag: 2.4.3
    1010
    1111Works with the Contact Form 7 plugin to send SMS notifications when somebody
     
    6767
    6868== Changelog ==
     69
     70= 2.4.3 =
     71* Remove old branding
     72* Fix form save bug
    6973
    7074= 2.4.2 =
Note: See TracChangeset for help on using the changeset viewer.