Skip to content

Commit

Permalink
Allow blank inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
mikejolley committed Sep 27, 2011
1 parent 48ee9fb commit 85af6e7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions classes/gateways/gateway.class.php
Expand Up @@ -384,7 +384,7 @@ function validate_checkbox_field ( $key ) {
function validate_text_field ( $key ) {
$text = (isset($this->settings[$key])) ? $this->settings[$key] : '';

if ( isset( $_POST[$this->plugin_id . $this->id . '_' . $key] ) && ( '' != $_POST[$this->plugin_id . $this->id . '_' . $key] ) ) {
if ( isset( $_POST[$this->plugin_id . $this->id . '_' . $key] ) ) {
$text = esc_attr( woocommerce_clean( $_POST[$this->plugin_id . $this->id . '_' . $key] ) );
}

Expand All @@ -402,7 +402,7 @@ function validate_text_field ( $key ) {
function validate_textarea_field ( $key ) {
$text = (isset($this->settings[$key])) ? $this->settings[$key] : '';

if ( isset( $_POST[$this->plugin_id . $this->id . '_' . $key] ) && ( '' != $_POST[$this->plugin_id . $this->id . '_' . $key] ) ) {
if ( isset( $_POST[$this->plugin_id . $this->id . '_' . $key] ) ) {
$text = esc_attr( woocommerce_clean( $_POST[$this->plugin_id . $this->id . '_' . $key] ) );
}

Expand All @@ -420,7 +420,7 @@ function validate_textarea_field ( $key ) {
function validate_select_field ( $key ) {
$value = (isset($this->settings[$key])) ? $this->settings[$key] : '';

if ( isset( $_POST[$this->plugin_id . $this->id . '_' . $key] ) && ( '' != $_POST[$this->plugin_id . $this->id . '_' . $key] ) ) {
if ( isset( $_POST[$this->plugin_id . $this->id . '_' . $key] ) ) {
$value = esc_attr( woocommerce_clean( $_POST[$this->plugin_id . $this->id . '_' . $key] ) );
}

Expand All @@ -438,7 +438,7 @@ function validate_select_field ( $key ) {
function validate_multiselect_field ( $key ) {
$value = (isset($this->settings[$key])) ? $this->settings[$key] : '';

if ( isset( $_POST[$this->plugin_id . $this->id . '_' . $key] ) && ( '' != $_POST[$this->plugin_id . $this->id . '_' . $key] ) ) {
if ( isset( $_POST[$this->plugin_id . $this->id . '_' . $key] ) ) {
$value = array_map('esc_attr', array_map('woocommerce_clean', (array) $_POST[$this->plugin_id . $this->id . '_' . $key] ));
}

Expand Down

0 comments on commit 85af6e7

Please sign in to comment.