mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-06-05 15:09:37 +09:00
Merge pull request #1514 from ultimatemember/fix/rating_field
Rating field
This commit is contained in:
@@ -679,16 +679,15 @@ add_filter( 'um_get_custom_field_array', 'um_get_custom_field_array', 99, 2 );
|
||||
* @return mixed
|
||||
*/
|
||||
function um_force_utf8_fields( $value, $data, $type = '' ) {
|
||||
|
||||
if( ! UM()->options()->get('um_force_utf8_strings') )
|
||||
if ( ! UM()->options()->get( 'um_force_utf8_strings' ) ) {
|
||||
return $value;
|
||||
|
||||
$value = um_force_utf8_string( $value );
|
||||
|
||||
return $value;
|
||||
|
||||
}
|
||||
add_filter('um_profile_field_filter_hook__','um_force_utf8_fields', 9, 3 );
|
||||
|
||||
$value = um_force_utf8_string( $value );
|
||||
|
||||
return $value;
|
||||
}
|
||||
add_filter( 'um_profile_field_filter_hook__', 'um_force_utf8_fields', 9, 3 );
|
||||
|
||||
|
||||
/**
|
||||
@@ -851,11 +850,11 @@ function um_profile_field_filter_xss_validation( $value, $data, $type = '' ) {
|
||||
$value = 0;
|
||||
} else {
|
||||
if ( 5 === absint( $data['number'] ) ) {
|
||||
if ( ! in_array( $value, range( 1, 5 ), true ) ) {
|
||||
if ( ! in_array( absint( $value ), range( 1, 5 ), true ) ) {
|
||||
$value = 0;
|
||||
}
|
||||
} elseif ( 10 === $data['number'] ) {
|
||||
if ( ! in_array( $value, range( 1, 10 ), true ) ) {
|
||||
if ( ! in_array( absint( $value ), range( 1, 10 ), true ) ) {
|
||||
$value = 0;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user