diff --git a/includes/core/um-actions-register.php b/includes/core/um-actions-register.php index e9a6afc0..9081cf43 100644 --- a/includes/core/um-actions-register.php +++ b/includes/core/um-actions-register.php @@ -350,7 +350,8 @@ function um_submit_form_register( $args ) { $unique_userID = uniqid(); - if ( empty( $user_login ) || strlen( $user_login ) > 30 && ! is_email( $user_login ) ) { + // see dbDelta and WP native DB structure user_login varchar(60) + if ( empty( $user_login ) || mb_strlen( $user_login ) > 60 && ! is_email( $user_login ) ) { $user_login = 'user' . $unique_userID; while ( username_exists( $user_login ) ) { $unique_userID = uniqid(); diff --git a/includes/um-short-functions.php b/includes/um-short-functions.php index 092a21b9..416137c6 100644 --- a/includes/um-short-functions.php +++ b/includes/um-short-functions.php @@ -14,7 +14,7 @@ * @return string */ function um_trim_string( $s, $length = 20 ) { - $s = strlen( $s ) > $length ? substr( $s, 0, $length ) . "..." : $s; + $s = mb_strlen( $s ) > $length ? substr( $s, 0, $length ) . "..." : $s; return $s; }