diff --git a/README.md b/README.md index 666affe8..babf0b19 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ Ultimate Member is the #1 user profile & membership plugin for WordPress. The pl | Latest Version |Requires at least|Stable Tag| | :------------: |:------------:|:------------:| -| 2.0.46 | WordPress 4.9 or higher| 2.0.46 | +| 2.0.47 | WordPress 4.9 or higher| 2.0.47 | Features of the plugin include: @@ -48,7 +48,7 @@ GNU Version 2 or Any Later Version Releases ==================== -[Official Release Version: 2.0.46](https://github.com/ultimatemember/ultimatemember/releases/tag/2.0.46). +[Official Release Version: 2.0.47](https://github.com/ultimatemember/ultimatemember/releases/tag/2.0.47). Changelog ==================== diff --git a/includes/class-functions.php b/includes/class-functions.php index 6048898c..abf6d692 100644 --- a/includes/class-functions.php +++ b/includes/class-functions.php @@ -167,7 +167,7 @@ if ( ! class_exists( 'UM_Functions' ) ) { } $path = ''; - if( $basename ) { + if ( $basename ) { $array = explode( '/', trim( $basename, '/' ) ); $path = $array[0]; } @@ -279,8 +279,8 @@ if ( ! class_exists( 'UM_Functions' ) ) { trailingslashit( 'ultimate-member/' . $path ) . $template_name ) ); - if( !$template ) { - if( $path ) { + if ( ! $template ) { + if ( $path ) { $template = trailingslashit( trailingslashit( WP_PLUGIN_DIR ) . $path ); } else { $template = trailingslashit( um_path ); diff --git a/includes/class-init.php b/includes/class-init.php index e27b90ca..4ee8b49b 100644 --- a/includes/class-init.php +++ b/includes/class-init.php @@ -1417,10 +1417,11 @@ if ( ! class_exists( 'UM' ) ) { return $this->classes['mobile']; } + /** * @since 2.0.44 * - * @return um\lib\mobiledetect\Um_Mobile_Detect + * @return um\core\Multisite */ function multisite() { @@ -1431,6 +1432,7 @@ if ( ! class_exists( 'UM' ) ) { return $this->classes['multisite']; } + /** * Include files with hooked filters/actions * diff --git a/includes/core/class-fields.php b/includes/core/class-fields.php index 0b21ffc7..bdf2c75a 100644 --- a/includes/core/class-fields.php +++ b/includes/core/class-fields.php @@ -2304,13 +2304,13 @@ if ( ! class_exists( 'um\core\Fields' ) ) { $img = ''; } $output .= '
' . __( 'Change photo', 'ultimate-member' ) . ''; + ' . $img . ' + ' . __( 'Change photo', 'ultimate-member' ) . ''; } else { $output .= '' . $button_text . ''; + ' . $button_text . ''; } $output .= ''; /* modal hidden */ diff --git a/includes/core/class-validation.php b/includes/core/class-validation.php index f48a9adb..e0c02298 100644 --- a/includes/core/class-validation.php +++ b/includes/core/class-validation.php @@ -75,7 +75,7 @@ if ( ! class_exists( 'um\core\Validation' ) ) { //validation of correct values from options in wp-admin if ( in_array( $fields[ $key ]['type'], array( 'select' ) ) && isset( $value ) && ! empty( $fields[ $key ]['options'] ) && - ! in_array( $value, $fields[ $key ]['options'] ) ) { + ! in_array( stripslashes( $value ), array_map( 'trim', $fields[ $key ]['options'] ) ) ) { unset( $changes[ $key ] ); } @@ -83,8 +83,8 @@ if ( ! class_exists( 'um\core\Validation' ) ) { //the user cannot set invalid value in the hidden input at the page if ( in_array( $fields[ $key ]['type'], array( 'multiselect', 'checkbox', 'radio' ) ) && isset( $value ) && ! empty( $fields[ $key ]['options'] ) ) { - - $changes[ $key ] = array_intersect( $value, $fields[ $key ]['options'] ); + $value = array_map( 'stripslashes', array_map( 'trim', $value ) ); + $changes[ $key ] = array_intersect( $value, array_map( 'trim', $fields[ $key ]['options'] ) ); } } diff --git a/includes/core/um-actions-profile.php b/includes/core/um-actions-profile.php index 07fed1a2..541c2057 100644 --- a/includes/core/um-actions-profile.php +++ b/includes/core/um-actions-profile.php @@ -249,7 +249,7 @@ function um_user_edit_profile( $args ) { //validation of correct values from options in wp-admin if ( in_array( $array['type'], array( 'select' ) ) && isset( $args['submitted'][ $key ] ) && ! empty( $array['options'] ) && - ! in_array( $args['submitted'][ $key ], $array['options'] ) ) { + ! in_array( stripslashes( $args['submitted'][ $key ] ), array_map( 'trim', $array['options'] ) ) ) { continue; } @@ -257,8 +257,8 @@ function um_user_edit_profile( $args ) { //the user cannot set invalid value in the hidden input at the page if ( in_array( $array['type'], array( 'multiselect', 'checkbox', 'radio' ) ) && isset( $args['submitted'][ $key ] ) && ! empty( $array['options'] ) ) { - - $args['submitted'][ $key ] = array_intersect( $args['submitted'][ $key ], $array['options'] ); + $args['submitted'][ $key ] = array_map( 'stripslashes', array_map( 'trim', $args['submitted'][ $key ] ) ); + $args['submitted'][ $key ] = array_intersect( $args['submitted'][ $key ], array_map( 'trim', $array['options'] ) ); } if ( $array['type'] == 'multiselect' || $array['type'] == 'checkbox' && ! isset( $args['submitted'][ $key ] ) ) { @@ -566,7 +566,7 @@ function um_profile_header_cover_area( $args ) { ?> -