|
Page 1 of 1
|
Ripley
Joined: October 2009
Posts: 76
Location: Ufa
|
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
|
#1 Thu 04 Mar, 2010 17:22 |
|
Sponsors
|
Icy Phoenix is an open source project, you can show your appreciation and support future development by donating to the project.
|
|
TheSteffen
Joined: August 2006
Posts: 1625
Location: Magdeburg
|
Re: Nickname With Russian Letters
____________ TheSteffen
Often SEARCH is the quickest way to get support.
IcyPhoenix German Support
|
#2 Thu 04 Mar, 2010 20:22 |
|
Ripley
Joined: October 2009
Posts: 76
Location: Ufa
|
Re: Nickname With Russian Letters
It does not work
|
#3 Sat 06 Mar, 2010 23:43 |
|
TheSteffen
Joined: August 2006
Posts: 1625
Location: Magdeburg
|
Re: Nickname With Russian Letters
Have you done this?
OPEN includes/functions_validate.php
FIND
if (!preg_match("/^[a-z0-9&\-_ ]+$/i", $username))
REPLACE WITH
if (!preg_match("/^[a-z0-9&\-_ а-я]+$/i", $username))
Or maybe this
if (!preg_match("/^[a-z0-9&\-_ а-я]+$/i", $username))
For me it is working... but I only used some spezial letter like ÄÖÜäöüß
____________ TheSteffen
Often SEARCH is the quickest way to get support.
IcyPhoenix German Support
|
#4 Mon 08 Mar, 2010 17:33 |
|
Ripley
Joined: October 2009
Posts: 76
Location: Ufa
|
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
|
#5 Tue 09 Mar, 2010 02:00 |
|
TheSteffen
Joined: August 2006
Posts: 1625
Location: Magdeburg
|
Re: Nickname With Russian Letters
My seconde one should be different... but it isn't here.
Can you try to insert 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
if (!preg_match("/^[a-z0-9&\-_ АаБб and so on]+$/i", $username))
____________ TheSteffen
Often SEARCH is the quickest way to get support.
IcyPhoenix German Support
|
#6 Tue 09 Mar, 2010 09:03 |
|
Ripley
Joined: October 2009
Posts: 76
Location: Ufa
|
Re: Nickname With Russian Letters
TheSteffen, 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..
|
#7 Tue 09 Mar, 2010 14:30 |
|
TheSteffen
Joined: August 2006
Posts: 1625
Location: Magdeburg
|
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.
____________ TheSteffen
Often SEARCH is the quickest way to get support.
IcyPhoenix German Support
|
#8 Wed 10 Mar, 2010 10:30 |
|
Ripley
Joined: October 2009
Posts: 76
Location: Ufa
|
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.
Hello, yes I did not found how to deactivate username control in ACP I'll try this &_#1072;-&_#1103; tomorrow Thanks for reply
|
#9 Wed 10 Mar, 2010 19:27 |
|
BIG BOSS
Joined: March 2008
Posts: 42
Location:
|
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:
<?php
/***************************************************************************
* functions_validate.php
* -------------------
* begin : Saturday, Feb 13, 2001
* copyright : (C) 2001 The phpBB Group
* email : support@phpbb.com
*
* $Id: functions_validate.php,v 1.6.2.12 2003/06/09 19:13:05 psotfx Exp $
*
*
***************************************************************************/
/***************************************************************************
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
***************************************************************************/
//
// Check to see if the username has been taken, or if it is disallowed.
// Also checks if it includes the " character, which we don't allow in usernames.
// Used for registering, changing names, and posting anonymously with a username
//
function validate_username($username)
{
global $db, $lang, $userdata;
// Remove doubled up spaces
$username = preg_replace('#\s+#', ' ', trim($username));
$username = phpbb_clean_username($username);
$sql = "SELECT username
FROM " . USERS_TABLE . "
WHERE LOWER(username) = '" . strtolower($username) . "'";
if ($result = $db->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;
}
?>
Save and upload to server.
____________ Regards,
BIG BOSS
|
#10 Thu 25 Mar, 2010 15:36 |
|
Ripley
Joined: October 2009
Posts: 76
Location: Ufa
|
Re: Nickname With Russian Letters
BIG BOSS, thank you very much, it works!!!
|
#11 Fri 26 Mar, 2010 11:12 |
|
|
Page 1 of 1
|
Was this topic useful?
Was this topic useful?
Link this topic |
URL |
|
BBCode |
|
HTML |
|
You cannot post new topics You cannot reply to topics You cannot edit your posts You cannot delete your posts You cannot vote in polls You cannot attach files You can download files You cannot post calendar events
|
|
|
|