FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum Development » Bug Reports » Distorted cyrillic logins (When a user tries to register with cyrillic login, it becomes distorted)
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
Distorted cyrillic logins [message #160753] Wed, 21 October 2009 14:59 Go to next message
gorm is currently offline  gorm
Messages: 29
Registered: October 2009
Location: Moscow, Russia
Karma: 0
Junior Member
After looking through many different forums I chose FUDforum. I installed FUDforum 3.0.0 RC2 and it works except that it is not possible to register users with Cyrillic logins. They become distorted after registration or even immediately in the form in case of unsuccessful registration.

I use Ubuntu 9.04 with apache, locale is ru_RU.utf8, the forum is configured for SQLite and ru_RU.utf8 is set in the theme manager.
Re: Distorted cyrillic logins [message #160754 is a reply to message #160753] Wed, 21 October 2009 15:05 Go to previous messageGo to next message
naudefj is currently offline  naudefj   South Africa
Messages: 3771
Registered: December 2004
Karma: 28
Senior Member
Administrator
Core Developer
Can you please post an example Cyrillic login that we can use to test?
Re: Distorted cyrillic logins [message #160755 is a reply to message #160754] Wed, 21 October 2009 16:57 Go to previous messageGo to next message
gorm is currently offline  gorm
Messages: 29
Registered: October 2009
Location: Moscow, Russia
Karma: 0
Junior Member
Here is an example

Теst login: Товарищ

index.php?t=getfile&id=5747&private=0index.php?t=getfile&id=5748&private=0
  • Attachment: reg1.png
    (Size: 8.84KB, Downloaded 1214 times)
  • Attachment: Reg2.png
    (Size: 8.38KB, Downloaded 1099 times)

[Updated on: Wed, 21 October 2009 17:21]

Report message to a moderator

Re: Distorted cyrillic logins [message #160771 is a reply to message #160755] Thu, 22 October 2009 17:23 Go to previous messageGo to next message
naudefj is currently offline  naudefj   South Africa
Messages: 3771
Registered: December 2004
Karma: 28
Senior Member
Administrator
Core Developer
Here is a patch for you to evaluate and test:

RCS file: /forum21/install/forum_data/src/register.php.t,v
retrieving revision 1.181
diff -u -a -r1.181 register.php.t
--- install/forum_data/src/register.php.t	15 Sep 2009 18:11:29 -0000	1.181
+++ install/forum_data/src/register.php.t	22 Oct 2009 17:09:58 -0000
@@ -55,15 +55,14 @@
 
 function sanitize_login($login)
 {
-	$list = '&'.chr(173);
+	// Remove control, formatting, and surrogate characters.
+	$login = preg_replace( '/[\p{Cc}\p{Cf}\p{Cs}]/u', ' ', $login);
 
-	for ($i = 0; $i < 32; $i++) {
-		$list .= chr($i);
-	}
-	for ($i = 127; $i < 161; $i++) {
-		$list .= chr($i);
-	}
-	return strtr($login, $list, str_repeat(" ", strlen($list)));
+	// Other "bad" characters to remove.
+	$badchars = '&';
+	for ($i = 0; $i < 32; $i++) $badchars .= chr($i);
+
+	return strtr($login, $badchars, str_repeat(' ', strlen($badchars)));
 }
 
 function register_form_check($user_id)
Re: Distorted cyrillic logins [message #160773 is a reply to message #160771] Thu, 22 October 2009 20:07 Go to previous messageGo to next message
gorm is currently offline  gorm
Messages: 29
Registered: October 2009
Location: Moscow, Russia
Karma: 0
Junior Member
I've made the required modifications in the file register.php.t.
Unfortunately nothing changed.
Re: Distorted cyrillic logins [message #160774 is a reply to message #160773] Thu, 22 October 2009 20:19 Go to previous messageGo to next message
naudefj is currently offline  naudefj   South Africa
Messages: 3771
Registered: December 2004
Karma: 28
Senior Member
Administrator
Core Developer
Did you rebuild the theme after applying it?
Re: Distorted cyrillic logins [message #160780 is a reply to message #160773] Fri, 23 October 2009 06:42 Go to previous messageGo to next message
gorm is currently offline  gorm   Russian Federation
Messages: 29
Registered: October 2009
Location: Moscow, Russia
Karma: 0
Junior Member
Thank you very much. Indeed that was the issue. Now it works and the problem is fixed.
Re: Distorted cyrillic logins [message #160812 is a reply to message #160780] Sat, 24 October 2009 22:03 Go to previous messageGo to next message
naudefj is currently offline  naudefj   South Africa
Messages: 3771
Registered: December 2004
Karma: 28
Senior Member
Administrator
Core Developer
Patch was applied as part of http://cvs.prohost.org/c/index.cgi/FUDforum/chngview?cn=12060
Re: Distorted cyrillic logins [message #160858 is a reply to message #160812] Tue, 03 November 2009 17:06 Go to previous messageGo to next message
gorm is currently offline  gorm   Russian Federation
Messages: 29
Registered: October 2009
Location: Moscow, Russia
Karma: 0
Junior Member
Now another problem. In Admin Control panel the codepage is reset
every time into ISO-8859-5 instead of UTF-8 as everywhere else.
Re: Distorted cyrillic logins [message #160863 is a reply to message #160858] Tue, 03 November 2009 21:35 Go to previous messageGo to next message
naudefj is currently offline  naudefj   South Africa
Messages: 3771
Registered: December 2004
Karma: 28
Senior Member
Administrator
Core Developer
Please checkout and use the latest www_root/adm/header.php from the repository.
Re: Distorted cyrillic logins [message #160866 is a reply to message #160863] Wed, 04 November 2009 00:05 Go to previous message
gorm is currently offline  gorm
Messages: 29
Registered: October 2009
Location: Moscow, Russia
Karma: 0
Junior Member
Thank you. I found that it was because I added 1.4 patch to ver. 1.2.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: The pictures are not recognized
Next Topic: Undefined variable: msg_poster_notif
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Fri May 24 15:35:23 GMT 2024

Total time taken to generate the page: 0.02611 seconds