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 :: Unread Messages :: Show Polls :: Message Navigator
| Subscribe to topic | Bookmark topic 
Switch to threaded view of this topic Create a new topic Submit Reply
Distorted cyrillic logins [message #160753] Wed, 21 October 2009 10:59 Go to next message
gorm is currently offline  gorm
Messages: 29
Registered: October 2009
Location: Moscow, Russia
Karma: 0
Junior Member
add to buddy list
ignore all messages by this user
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 11:05 Go to previous messageGo to next message
naudefj is currently offline  naudefj   South Africa
Messages: 3624
Registered: December 2004
Karma: 17
Senior Member
Administrator
Core Developer
remove from buddy list
ignore all messages by this user
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 12: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
add to buddy list
ignore all messages by this user
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 371 times)
  • Attachment: Reg2.png
    (Size: 8.38KB, Downloaded 362 times)

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

Report message to a moderator

Re: Distorted cyrillic logins [message #160771 is a reply to message #160755] Thu, 22 October 2009 13:23 Go to previous messageGo to next message
naudefj is currently offline  naudefj   South Africa
Messages: 3624
Registered: December 2004
Karma: 17
Senior Member
Administrator
Core Developer
remove from buddy list
ignore all messages by this user
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 16: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
add to buddy list
ignore all messages by this user
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 16:19 Go to previous messageGo to next message
naudefj is currently offline  naudefj   South Africa
Messages: 3624
Registered: December 2004
Karma: 17
Senior Member
Administrator
Core Developer
remove from buddy list
ignore all messages by this user
Did you rebuild the theme after applying it?
Re: Distorted cyrillic logins [message #160780 is a reply to message #160773] Fri, 23 October 2009 02: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
add to buddy list
ignore all messages by this user
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 18:03 Go to previous messageGo to next message
naudefj is currently offline  naudefj   South Africa
Messages: 3624
Registered: December 2004
Karma: 17
Senior Member
Administrator
Core Developer
remove from buddy list
ignore all messages by this user
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 12: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
add to buddy list
ignore all messages by this user
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 16:35 Go to previous messageGo to next message
naudefj is currently offline  naudefj   South Africa
Messages: 3624
Registered: December 2004
Karma: 17
Senior Member
Administrator
Core Developer
remove from buddy list
ignore all messages by this user
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] Tue, 03 November 2009 19:05 Go to previous message
gorm is currently offline  gorm
Messages: 29
Registered: October 2009
Location: Moscow, Russia
Karma: 0
Junior Member
add to buddy list
ignore all messages by this user
Thank you. I found that it was because I added 1.4 patch to ver. 1.2.
Quick Reply
Formatting Tools:   
  Switch to threaded view of this topic Create a new topic
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: Thu Oct 19 07:09:44 EDT 2017

Total time taken to generate the page: 0.00820 seconds