Skip to content

Commit

Permalink
Add validations for textarea custom fields
Browse files Browse the repository at this point in the history
Add textarea custom field type to the api functions that perform
validations.

Fixes: #21178
  • Loading branch information
cproensa authored and dregad committed Aug 5, 2016
1 parent e4d257f commit 08c261d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions core/custom_field_api.php
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions core/gpc_api.php
Expand Up @@ -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 );
Expand Down

0 comments on commit 08c261d

Please sign in to comment.