salif:
it does not work if the accent is the first letter of the name (as émilien) or if this first letter is capitalzed (as Émilien)
Oh! I've got it now.
At first — you are right — the initial setting should have both capitalized and regular letters defined separately:
$userRegName="A-Za-zÀÂÇÉÈÊËÎÏÔÛÙÜŸÑÆŒàâçéèêëîïôûùüÿñæœ0-9_' -.";
Second, you have to extend
bb_specials.php with the function regarding your forum specifics:
1) Save
bb_specials.php in UTF-8
2) Closer to the end of this file before ?> re-compose the following default function (listed as of miniBB 3.7.2 — but I've marked the fragment which differs from default):
function verifyUsername($uname){
//should contain only pre-defined symbols
if(!preg_match("#^[".$GLOBALS['userRegName']."]+$#", $uname) or strlen_unicode($uname)<$GLOBALS['umin'] or strlen_unicode($uname)>$GLOBALS['umax']) return FALSE;
//should not consist of digits only
elseif(preg_match("#^[0-9]+$#", $uname)) return FALSE;
//should be sensful alphanumerical
elseif(preg_match("#^([0-9]+)(.*)$#", $uname)) return FALSE;
//should not consist of repeated character only (like '______' etc.)
elseif(count_chars_unicode($uname)<=1) return FALSE;
//should start only with an allowed character, and not with '_'
elseif(!preg_match("#[A-Za-zÀÂÇÉÈÊËÎÏÔÛÙÜŸÑÆŒàâçéèêëîïôûùüÿñæœ0-9]#", substr_unicode($uname,0,1)) or !preg_match("#[A-Za-zÀÂÇÉÈÊËÎÏÔÛÙÜŸÑÆŒàâçéèêëîïôûùüÿñæœ0-9.]#", substr_unicode($uname, strlen_unicode($uname)-1, 1))) return FALSE;
//should contain only one apostrophe, or one space, or one underscore, or one dash per username
elseif(substr_count($uname, "'")>1 or substr_count($uname, '-')>1 or substr_count($uname, '_')>1 or substr_count($uname, ' ')>1 or substr_count($uname, '.')>1) return FALSE;
else return TRUE;
}
You could also then introduce your own limits or extensions regarding usernames in this function.
salif:
I have tried the demo and the message is
Yes, it's a default message and I didn't change it for this exact demo purpose — but on your side, you should preferably update it in the language pack —
$l_userErrors[1].