Merge branch 'release/2.0.26' of https://github.com/ultimatemember/ultimatemember into release/2.0.26

This commit is contained in:
nikitozzzzzzz
2018-10-01 15:44:03 +03:00
2 changed files with 16 additions and 4 deletions
+8 -2
View File
@@ -346,7 +346,10 @@ function um_submit_form_errors_hook_( $args ) {
continue 2;
}
} elseif ( $op == 'contains' ) {
if ( strstr( $cond_value, $parent_value ) ) {
if ( is_string( $cond_value ) && strstr( $cond_value, $parent_value ) ) {
continue 2;
}
if( is_array( $cond_value ) && in_array( $parent_value, $cond_value ) ) {
continue 2;
}
}
@@ -376,7 +379,10 @@ function um_submit_form_errors_hook_( $args ) {
continue 2;
}
} elseif ( $op == 'contains' ) {
if ( ! strstr( $cond_value, $parent_value ) ) {
if ( is_string( $cond_value ) && ! strstr( $cond_value, $parent_value ) ) {
continue 2;
}
if( is_array( $cond_value ) && !in_array( $parent_value, $cond_value ) ) {
continue 2;
}
}
+8 -2
View File
@@ -405,7 +405,10 @@ function um_get_custom_field_array( $array, $fields ) {
$array['required'] = 0;
}
} elseif ( $op == 'contains' ) {
if ( strstr( $cond_value, $parent_value ) ) {
if ( is_string( $cond_value ) && strstr( $cond_value, $parent_value ) ) {
$array['required'] = 0;
}
if( is_array( $cond_value ) && in_array( $parent_value, $cond_value ) ) {
$array['required'] = 0;
}
}
@@ -435,7 +438,10 @@ function um_get_custom_field_array( $array, $fields ) {
$array['required'] = 0;
}
} elseif ( $op == 'contains' ) {
if ( ! strstr( $cond_value, $parent_value ) ) {
if( is_string( $cond_value ) && !strstr( $cond_value, $parent_value ) ) {
$array['required'] = 0;
}
if( is_array( $cond_value ) && !in_array( $parent_value, $cond_value ) ) {
$array['required'] = 0;
}
}