From 08c261d33b1376ded12683c612e81d97f82fc441 Mon Sep 17 00:00:00 2001 From: Carlos Proensa Date: Fri, 5 Aug 2016 00:12:57 +0200 Subject: [PATCH] Add validations for textarea custom fields Add textarea custom field type to the api functions that perform validations. Fixes: #21178 --- core/custom_field_api.php | 1 + core/gpc_api.php | 1 + 2 files changed, 2 insertions(+) diff --git a/core/custom_field_api.php b/core/custom_field_api.php index f64c25fd08..87ee8251d9 100644 --- a/core/custom_field_api.php +++ b/core/custom_field_api.php @@ -983,6 +983,7 @@ function custom_field_validate( $p_field_id, $p_value ) { $t_length = utf8_strlen( $p_value ); switch( $t_type ) { case CUSTOM_FIELD_TYPE_STRING: + case CUSTOM_FIELD_TYPE_TEXTAREA: # Empty fields are valid if( $t_length == 0 ) { break; diff --git a/core/gpc_api.php b/core/gpc_api.php index 4797bbb595..fc3e3affb0 100644 --- a/core/gpc_api.php +++ b/core/gpc_api.php @@ -186,6 +186,7 @@ function gpc_isset_custom_field( $p_var_name, $p_custom_field_type ) { case CUSTOM_FIELD_TYPE_FLOAT: case CUSTOM_FIELD_TYPE_ENUM: case CUSTOM_FIELD_TYPE_EMAIL: + case CUSTOM_FIELD_TYPE_TEXTAREA: return gpc_isset( $t_field_name ) && !is_blank( gpc_get_string( $t_field_name ) ); default: return gpc_isset( $t_field_name );