- added fix for options if they contains spaces in the start and the end of option (added trim);

This commit is contained in:
nikitasinelnikov
2020-01-21 15:13:33 +02:00
parent 7841911413
commit 6a93771511
4 changed files with 9 additions and 7 deletions
+3 -1
View File
@@ -951,7 +951,9 @@ if ( ! class_exists( 'um\admin\core\Admin_Builder' ) ) {
<input type="hidden" name="_position" id="_position" value="<?php echo $metabox->edit_array['position']; ?>" />
<?php if ( isset( $args['mce_content'] ) ) { ?><div class="dynamic-mce-content"><?php echo $metabox->edit_array['content']; ?></div><?php } ?>
<?php if ( isset( $args['mce_content'] ) ) { ?>
<div class="dynamic-mce-content"><?php echo ! empty( $metabox->edit_array['content'] ) ? $metabox->edit_array['content'] : ''; ?></div>
<?php } ?>
<?php $this->modal_header(); ?>
+3 -3
View File
@@ -609,11 +609,11 @@ if ( ! class_exists( 'um\core\Member_Directory' ) ) {
if ( $attrs['metakey'] != 'online_status' ) {
if ( $attrs['metakey'] != 'role_select' && $attrs['metakey'] != 'mycred_rank' && empty( $custom_dropdown ) ) {
$attrs['options'] = array_intersect( array_map( 'stripslashes', $attrs['options'] ), $values_array );
$attrs['options'] = array_intersect( array_map( 'stripslashes', array_map( 'trim', $attrs['options'] ) ), $values_array );
} elseif ( ! empty( $custom_dropdown ) ) {
$attrs['options'] = array_intersect_key( $attrs['options'], array_flip( $values_array ) );
$attrs['options'] = array_intersect_key( array_map( 'trim', $attrs['options'] ), array_flip( $values_array ) );
} else {
$attrs['options'] = array_intersect_key( $attrs['options'], array_flip( $values_array ) );
$attrs['options'] = array_intersect_key( array_map( 'trim', $attrs['options'] ), array_flip( $values_array ) );
}
}
+2 -2
View File
@@ -709,14 +709,14 @@ function um_profile_field_filter_xss_validation( $value, $data, $type = '' ) {
}
}
} elseif ( 'select' == $type || 'radio' == $type ) {
if ( ! empty( $data['options'] ) && ! in_array( $value, $data['options'] ) && empty( $data['custom_dropdown_options_source'] ) ) {
if ( ! empty( $data['options'] ) && ! in_array( $value, array_map( 'trim', $data['options'] ) ) && empty( $data['custom_dropdown_options_source'] ) ) {
$value = '';
}
}
} elseif ( ! empty( $value ) && is_array( $value ) ) {
if ( 'multiselect' == $type || 'checkbox' == $type ) {
if ( ! empty( $data['options'] ) && empty( $data['custom_dropdown_options_source'] ) ) {
$value = array_intersect( $value, $data['options'] );
$value = array_intersect( $value, array_map( 'trim', $data['options'] ) );
}
}
}
+1 -1
View File
@@ -145,7 +145,7 @@ The plugin works with popular caching plugins by automatically excluding Ultimat
* To learn more about version 2.1 please see this [topic](https://wordpress.org/support/topic/version-2-1-4/)
* UM2.1+ is a significant update to the Member Directories' code base from 2.0.x. Please make sure you take a full-site backup with restore point before updating the plugin
= 2.1.3: January 20, 2020 =
= 2.1.3: January 21, 2020 =
* Enhancements: