https://www.icyphoenix.com/viewtopic.php?f=35&t=7009 ----------------------------------- Ripley Thu 04 Mar, 2010 17:22 Nickname With Russian Letters ----------------------------------- Hello, please tell me where can I change the option which allow users to register nicknames with russian letters, it is now only a-z allowed :? ----------------------------------- TheSteffen Thu 04 Mar, 2010 20:22 Re: Nickname With Russian Letters ----------------------------------- Take a look here: http://www.icyphoenix.com/viewtopic.php?f=4&t=1524 ----------------------------------- Ripley Sat 06 Mar, 2010 23:43 Re: Nickname With Russian Letters ----------------------------------- [quote user="TheSteffen" post="48167"]Take a look here: http://www.icyphoenix.com/viewtopic.php?f=4&t=1524[/quote] It does not work :? ----------------------------------- TheSteffen Mon 08 Mar, 2010 17:33 Re: Nickname With Russian Letters ----------------------------------- Have you done this? OPEN [b]includes/functions_validate.php[/b] FIND [codeblock]if (!preg_match("/^[a-z0-9&\-_ ]+$/i", $username))[/codeblock] REPLACE WITH [codeblock]if (!preg_match("/^[a-z0-9&\-_ а-я]+$/i", $username))[/codeblock] Or maybe this [codeblock]if (!preg_match("/^[a-z0-9&\-_ а-я]+$/i", $username))[/codeblock] For me it is working... but I only used some spezial letter like ÄÖÜäöüß ----------------------------------- Ripley Tue 09 Mar, 2010 02:00 Re: Nickname With Russian Letters ----------------------------------- Yes, I did everything from this topic http://www.icyphoenix.com/viewtopic.php?f=4&t=1524 Changed includes/functions_validate.php and lang main.php at eng and russian folders, cleared cache several times, then tried to register different nicknames with ru letters from different browsers, but in doubt :| What is interesting - users that done registration containing russian letters at phpbb3 before we converted to ip, can still log in to the forum :? . But no one is able to register, and it is a problem, because we are russian forum ----------------------------------- TheSteffen Tue 09 Mar, 2010 09:03 Re: Nickname With Russian Letters ----------------------------------- My seconde one should be different... but it isn't here. Can you try to insert [code linenumbers=false]&_#1072;-&_#1103;[/code] without this _ This are the HTML Codes for Russian (Cyrillic) Anyway, what is helping for sure is, if you inserte every letter you want in big and small letters [code linenumbers=false]if (!preg_match("/^[a-z0-9&\-_ АаБб and so on]+$/i", $username))[/code] ----------------------------------- Ripley Tue 09 Mar, 2010 14:30 Re: Nickname With Russian Letters ----------------------------------- [b]TheSteffen[/b], thank you very much, I tried this: preg_match("/^[a-z0-9&\-_ АаБбВвГгДдЕеЁёЖжЗзИиЙйКкЛлМмНнОоПпРрСсТтУуФфХхЦцЧчШшЩщЪъЫыЬьЭэЮюЯя]+$/i" here was a usual this username is not available if (!preg_match("/^[_0-9A-Za-zА-Яа-яЁё]+$/u", $username)) this was some error :[Icy Phoenix Debug] PHP Notice: in file /includes/functions_validate.php on line 103: preg_match() [function.preg-match]: Compilation failed: invalid UTF-8 string at offset 13 1 I saw 103 line is right here if (!preg_match("/^[_0-9A-Za-zА-Яа-яЁё]+$/u", $username)) , but I do not know wher exactly.. ----------------------------------- TheSteffen Wed 10 Mar, 2010 10:30 Re: Nickname With Russian Letters ----------------------------------- I am sorry, I am not so skilled. For me it is working :? You can deactivate this username controll compleatly, but I don't know how. Maybe someone else can help you. Or we have to wait for MG. I guess it would be easier with next IP release because of UTF-8, but this will need some time. ----------------------------------- Ripley Wed 10 Mar, 2010 19:27 Re: Nickname With Russian Letters ----------------------------------- [quote user="TheSteffen" post="48210"]I am sorry, I am not so skilled. For me it is working :? You can deactivate this username controll compleatly, but I don't know how. Maybe someone else can help you. Or we have to wait for MG. I guess it would be easier with next IP release because of UTF-8, but this will need some time.[/quote] Hello, yes I did not found how to deactivate username control in ACP I'll try this &_#1072;-&_#1103; tomorrow :P Thanks for reply [img]http://www.icyphoenix.com/images/smiles/love_friends_02.gif[/img] ----------------------------------- BIG BOSS Thu 25 Mar, 2010 15:36 Re: Nickname With Russian Letters ----------------------------------- Use it at your own risk, make a back up copy of the includes/functions_validate.php file first. Replace the content of the file with this: [code linenumbers=false] sql_query($sql)) { while ($row = $db->sql_fetchrow($result)) { if ( ($userdata['session_logged_in'] && ($row['username'] != $userdata['username'])) || !$userdata['session_logged_in']) { $db->sql_freeresult($result); return array('error' => true, 'error_msg' => $lang['Username_taken']); } } } $db->sql_freeresult($result); $sql = "SELECT group_name FROM " . GROUPS_TABLE . " WHERE LOWER(group_name) = '" . strtolower($username) . "'"; if ($result = $db->sql_query($sql)) { if ($row = $db->sql_fetchrow($result)) { $db->sql_freeresult($result); return array('error' => true, 'error_msg' => $lang['Username_taken']); } } $db->sql_freeresult($result); $sql = "SELECT disallow_username FROM " . DISALLOW_TABLE; if ($result = $db->sql_query($sql)) { if ($row = $db->sql_fetchrow($result)) { do { if (preg_match("#\b(" . str_replace("\*", ".*?", preg_quote($row['disallow_username'], '#')) . ")\b#i", $username)) { $db->sql_freeresult($result); return array('error' => true, 'error_msg' => $lang['Username_disallowed']); } } while($row = $db->sql_fetchrow($result)); } } $db->sql_freeresult($result); $sql = "SELECT word FROM " . WORDS_TABLE; if ($result = $db->sql_query($sql)) { if ($row = $db->sql_fetchrow($result)) { do { if (preg_match("#\b(" . str_replace("\*", ".*?", preg_quote($row['word'], '#')) . ")\b#i", $username)) { $db->sql_freeresult($result); return array('error' => true, 'error_msg' => $lang['Username_disallowed']); } } while ($row = $db->sql_fetchrow($result)); } } $db->sql_freeresult($result); // if ( !preg_match("/^[a-z0-9&\-_\/]+$/i", $username) ) // { // return array('error' => true, 'error_msg' => $lang['Forbidden_characters']); // } // Disallow " and ALT-255 in username. if (strstr($username, '"') || strstr($username, '"') || strstr($username, chr(160)) || strstr($username, chr(173))) { return array('error' => true, 'error_msg' => $lang['Username_invalid']); } return array('error' => false, 'error_msg' => ''); } // // Check to see if email address is banned // or already present in the DB // function validate_email($email) { global $db, $lang; if ($email != '') { if (preg_match('/^[a-z0-9&\'\.\-_\+]+@[a-z0-9\-]+\.([a-z0-9\-]+\.)*?[a-z]+$/is', $email)) { $sql = "SELECT ban_email FROM " . BANLIST_TABLE; if ($result = $db->sql_query($sql)) { if ($row = $db->sql_fetchrow($result)) { do { $match_email = str_replace('*', '.*?', $row['ban_email']); if (preg_match('/^' . $match_email . '$/is', $email)) { $db->sql_freeresult($result); return array('error' => true, 'error_msg' => $lang['Email_banned']); } } while($row = $db->sql_fetchrow($result)); } } $db->sql_freeresult($result); $sql = "SELECT user_email FROM " . USERS_TABLE . " WHERE user_email = '" . str_replace("\'", "''", $email) . "'"; if (!($result = $db->sql_query($sql))) { message_die(GENERAL_ERROR, "Couldn't obtain user email information.", "", __LINE__, __FILE__, $sql); } if ($row = $db->sql_fetchrow($result)) { return array('error' => true, 'error_msg' => $lang['Email_taken']); } $db->sql_freeresult($result); return array('error' => false, 'error_msg' => ''); } } return array('error' => true, 'error_msg' => $lang['Email_invalid']); } // // Does supplementary validation of optional profile fields. This expects common stuff like trim() and strip_tags() // to have already been run. Params are passed by-ref, so we can set them to the empty string if they fail. // function validate_optional_fields(&$icq, &$aim, &$msnm, &$yim, &$skype, &$website, &$location, &$occupation, &$interests, &$phone, &$selfdes, &$sig) { $check_var_length = array('aim', 'msnm', 'yim', 'skype', 'location', 'occupation', 'interests', 'sig'); for($i = 0; $i < count($check_var_length); $i++) { if (strlen($$check_var_length[$i]) < 2) { $$check_var_length[$i] = ''; } } // ICQ number has to be only numbers. if (!preg_match('/^[0-9]+$/', $icq)) { $icq = ''; } // website has to start with http://, followed by something with length at least 3 that // contains at least one dot. if ($website != "") { if (!preg_match('#^http[s]?:\/\/#i', $website)) { $website = 'http://' . $website; } if (!preg_match('#^http[s]?\\:\\/\\/[a-z0-9\-]+\.([a-z0-9\-]+\.)?[a-z]+#i', $website)) { $website = ''; } } return; } ?> [/code] Save and upload to server. ----------------------------------- Ripley Fri 26 Mar, 2010 11:12 Re: Nickname With Russian Letters ----------------------------------- [b]BIG BOSS[/b], thank you very much, it works!!!