Any characters/languages for usernames:
2.9.0 add a new option that will allow to add phpBB usernames transliterated into WordPress as
Latin alphabet (any language) as default,
OR into any other native language alphabet.
Code: Select all
define('WPW3ALL_USE_DEFAULT_WP_UCHARS', 1);
AND
Code: Select all
define( 'WPW3ALL_USE_UNAME_NATIVE_LANG_CHARS', 1 );
Considered alphabets are
Code: Select all
Arabic,Armenian,Bengali,Bopomofo,Braille,Buhid,Canadian_Aboriginal,Cherokee,Cyrillic,Devanagari,Ethiopic,Georgian,Greek,Gujarati,Gurmukhi,Han,Hangul,Hanunoo,Hebrew,Hiragana,Inherited,Kannada,Katakana,Khmer,Lao,Latin,Limbu,Malayalam,Mongolian,Myanmar,Ogham,Oriya,Runic,Sinhala,Syriac,Tagalog,Tagbanwa,TaiLe,Tamil,Telugu,Thaana,Thai,Tibetan,Yi
The integration code by default, if no option via DEFINE into the
wp-config.php as been set, will add phpBB usernames that are not Latin into WordPress, transliterated to Latin.
If
Code: Select all
define('WPW3ALL_USE_DEFAULT_WP_UCHARS', 1);
option is set, usernames into WordPress will be added as sanitized allowing these chars also into a WP MUMS multisite:
if not and if WP is MUMS, the username will added after that it has been purged from unwanted characters, so allowing only letters and numbers:
if
Code: Select all
define( 'WPW3ALL_USE_UNAME_NATIVE_LANG_CHARS', 1 );
is set, usernames are added into WordPress using the native language, after that it has been sanitized by unwanted characters (exactly like the Latin) like above mentioned.
The correct cleanup of the username by unwanted characters in any native language is performed using regular expressions that never fails.
The new added and used function that allow this, will reside into:
/wp-content/plugins/wp-w3all-phpbb-integration/common/helpers.php
It will start looking definitively like this:
Code: Select all
# function w3all_detectClean_language_chars
# Detect any text language
##$test = w3all_detectClean_language_chars($text, false, false, true);
// and return one of these
// Arabic,Armenian,Bengali,Bopomofo,Braille,Buhid,Canadian_Aboriginal,Cherokee,Cyrillic,Devanagari,Ethiopic,Georgian,Greek,Gujarati,Gurmukhi,Han,Hangul,Hanunoo,Hebrew,Hiragana,Inherited,Kannada,Katakana,Khmer,Lao,Latin,Limbu,Malayalam,Mongolian,Myanmar,Ogham,Oriya,Runic,Sinhala,Syriac,Tagalog,Tagbanwa,TaiLe,Tamil,Telugu,Thaana,Thai,Tibetan,Yi
# return sanitized text for -> MUMS that allow only '[0-9A-Za-z]'
##$test = w3all_detectClean_language_chars($text, true);
# return sanitized text for -> default WP '[-0-9A-Za-z _.@]'
##$test = w3all_detectClean_language_chars($text, false, false, false);
# return text transliterated to Latin text
##$test = w3all_detectClean_language_chars($text, false, true);
function w3all_detectClean_language_chars($text, $return_x_mums = false, $returnLatin = false, $returnDetectLang = false)
{
...
...