Author |
Message |
doffer83
Worker
![Worker Worker](modules/Forums/images/ranks/3stars.gif)
![](modules/Forums/images/avatars/d5c522c25233365e6b83d.jpg)
Joined: Apr 17, 2011
Posts: 117
Location: Amsterdam
|
Posted:
Sun Apr 17, 2011 3:19 am |
|
It is a nice module and much better than the standard your_account.. my question is can it accept new users with foreign languages like arabic. now I get an error if I try |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
montego
Site Admin
![](modules/Forums/images/avatars/0c0adf824792d6d341ef4.gif)
Joined: Aug 29, 2004
Posts: 9457
Location: Arizona
|
Posted:
Sat Apr 23, 2011 11:04 am |
|
doffer83, are you using PHP-Nuke with an older version of CNBYA or are you using the latest RavenNuke(tm) 2.40.01 software? Just need to be clear in case this is in the wrong forum. |
_________________ Only registered users can see links on this board! Get registered or login!
Only registered users can see links on this board! Get registered or login! |
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
doffer83
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Sat Apr 23, 2011 1:05 pm |
|
yes that is true.. I am new with forums so I need to learn how to be clear.. I use phpnuke 7.9 and it works great.. I also installed this CNBYA addon last beta version and I would like to make it accepts names with arabic Characters |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
fkelly
Former Moderator in Good Standing
![](modules/Forums/images/avatars/gallery/blank.gif)
Joined: Aug 30, 2005
Posts: 3312
Location: near Albany NY
|
Posted:
Sat Apr 23, 2011 2:35 pm |
|
Test it, but I doubt that RNYA, in its current form will allow arabic characters. Look in the modules/Your_Account/includes/functions.php. There is a function named ya_userCheck() there that does this:
Code: if ((!$username) || ($username == '') || (ereg('[^a-zA-Z0-9_-]', $username))) $stop = '<center>' . _ERRORINVNICK . '</center><br />';
|
That ereg would create an error on the characters you want to use. You could remove it (the ereg) or modify it but I can't say for sure that similar checks aren't made elsewhere in the software. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
doffer83
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Sat Apr 23, 2011 3:10 pm |
|
yaah thank you.. when you told me where to find that line I changed the
Code: if ((!$username) || ($username == '') || (ereg('[^a-zA-Z0-9_-]', $username))) $stop = '<center>' . _ERRORINVNICK . '</center><br />';
|
to
Code:if ((!$username) || ($username=="") || (ereg("[^Á-ía-zA-Z0-9_-]",$username))) $stop = "<center>"._ERRORINVNICK."</center><br>";
|
please one last wish.. how can I make it possible to register with a space between the first and the last name (as a nick name first input). I know I have to add to the code but I dont know how, and would that be a security whole/probleem?
thank you again. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
fkelly
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Sun Apr 24, 2011 7:31 am |
|
Well I googled "space character in ereg" and came up with this:
Only registered users can see links on this board! Get registered or login!
Give it a try. The Rnteam knows it needs to eliminate deprecated ereg's from the code but it's a big task that needs to be done in a coordinated fashion. You could continue to use ereg here or switch to preg_match, just be careful to test a number of combinations. Using the case insensitive switch as in the forum post I linked to would seem to make sense also instead of having separate a-z and A-Z's. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
hicuxunicorniobestbuildpc
The Mouse Is Extension Of Arm
![](modules/Forums/images/avatars/5ed231554a8492e2e09da.gif)
Joined: Aug 13, 2009
Posts: 1123
|
Posted:
Sun Apr 24, 2011 5:27 pm |
|
Code:if ((!$username) || ($username=="") || (ereg("[^Á-ía-zA-Z0-9_-]",$username))) $stop = "<center>"._ERRORINVNICK."</center><br>";
|
So
Code:if ((!$username) || ($username=="") || (pre_match("/[^Á-ía-zA-Z0-9_-]/",$username))) $stop = "<center>"._ERRORINVNICK."</center><br>";
|
|
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
fkelly
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Sun Apr 24, 2011 5:57 pm |
|
$username == "" which essentially says (I think) $username is empty and in which case you'd be better off saying if (empty($username)) ... but it's still not the same as having a blank character anywhere in the string. If you want to allow a blank character you are going to have to do what the forum post I linked to did. Or some variant. Also 'pre_match' != 'preg_match'. Also, it might be helpful to study up a bit on the use of double quotes versus single quotes. With single quotes the PHP interpreter doesn't have to do any more work. With double quotes it has to see what kind of data you have inside them and then figure out what to do. If you always know what you want it to do then use single quotes. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
|