username length and UTF8
-
You must use the PHP function mb_strlen to get username length for UTF8 characters and not strlen as UTF8 use 2 bytes for local characters.
strlen will return the result 6 characters for this string ???
and mb_string will return 3./wpum-username-length/includes/actions.php
lines 28/30
$username = $values['register']['username']; $min_length = wpum_get_option( 'username_min_length' ); $max_length = wpum_get_option( 'username_max_length' ); $length = mb_strlen( $username );
Plugin: WPUM Username Length version 2.0.0
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘username length and UTF8’ is closed to new replies.