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 .= '
- ' . $img . ' -
' . __( '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 ) { ?> -
' . __( 'Change cover photo', 'ultimate-member' ) . '', - '' . __( 'Remove', 'ultimate-member' ) . '', - '' . __( 'Cancel', 'ultimate-member' ) . '', + '' . __( 'Change cover photo', 'ultimate-member' ) . '', + '' . __( 'Remove', 'ultimate-member' ) . '', + '' . __( 'Cancel', 'ultimate-member' ) . '', ); UM()->profile()->new_ui( 'bc', 'div.um-cover', 'click', $items ); @@ -609,12 +609,10 @@ function um_profile_header_cover_area( $args ) {
- + mobile()->isMobile()) { - if (UM()->mobile()->isTablet()) { + if ( UM()->mobile()->isMobile() ) { + if ( UM()->mobile()->isTablet() ) { echo um_user( 'cover_photo', 1000 ); } else { echo um_user( 'cover_photo', 300 ); @@ -623,9 +621,7 @@ function um_profile_header_cover_area( $args ) { echo um_user( 'cover_photo', 1000 ); } - ?> - - user()->cannot_edit )) { ?> + if ( ! isset( UM()->user()->cannot_edit ) ) { ?> - @@ -735,8 +730,8 @@ function um_profile_header( $args ) { if (!um_profile( 'profile_photo' )) { // has profile photo $items = array( - '' . __( 'Upload photo', 'ultimate-member' ) . '', - '' . __( 'Cancel', 'ultimate-member' ) . '', + '' . __( 'Upload photo', 'ultimate-member' ) . '', + '' . __( 'Cancel', 'ultimate-member' ) . '', ); /** @@ -767,9 +762,9 @@ function um_profile_header( $args ) { } else if (UM()->fields()->editing == true) { $items = array( - '' . __( 'Change photo', 'ultimate-member' ) . '', - '' . __( 'Remove photo', 'ultimate-member' ) . '', - '' . __( 'Cancel', 'ultimate-member' ) . '', + '' . __( 'Change photo', 'ultimate-member' ) . '', + '' . __( 'Remove photo', 'ultimate-member' ) . '', + '' . __( 'Cancel', 'ultimate-member' ) . '', ); /** @@ -1121,7 +1116,7 @@ function um_add_edit_icon( $args ) { 'editprofile' => '' . __( 'Edit Profile', 'ultimate-member' ) . '', 'myaccount' => '' . __( 'My Account', 'ultimate-member' ) . '', 'logout' => '' . __( 'Logout', 'ultimate-member' ) . '', - 'cancel' => '' . __( 'Cancel', 'ultimate-member' ) . '', + 'cancel' => '' . __( 'Cancel', 'ultimate-member' ) . '', ); if ( ! empty( UM()->user()->cannot_edit ) ) { diff --git a/readme.txt b/readme.txt index 91c7d909..d9046564 100644 --- a/readme.txt +++ b/readme.txt @@ -6,7 +6,7 @@ Donate link: Tags: community, member, membership, user-profile, user-registration Requires at least: 4.9 Tested up to: 5.2 -Stable tag: 2.0.46 +Stable tag: 2.0.47 License: GNU Version 2 or Any Later Version License URI: http://www.gnu.org/licenses/gpl-3.0.txt @@ -133,6 +133,12 @@ The plugin works with popular caching plugins by automatically excluding Ultimat = Important: UM2.0+ is a significant update to the code base from 1.3.88. Please make sure you take a full-site backup with restore point before updating the plugin = += 2.0.47: May 13, 2019 = + +* Bugfixes: + - Fixed save special characters values + - Fixed trim fields options before validation + = 2.0.46: May 10, 2019 = * Bugfixes: diff --git a/ultimate-member.php b/ultimate-member.php index f78194f8..af89801b 100644 --- a/ultimate-member.php +++ b/ultimate-member.php @@ -3,7 +3,7 @@ Plugin Name: Ultimate Member Plugin URI: http://ultimatemember.com/ Description: The easiest way to create powerful online communities and beautiful user profiles with WordPress -Version: 2.0.46 +Version: 2.0.47 Author: Ultimate Member Author URI: http://ultimatemember.com/ Text Domain: ultimate-member