Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> CNB Your Account
Author Message
doffer83
Worker
Worker



Joined: Apr 17, 2011
Posts: 117
Location: Amsterdam

PostPosted: Sun Apr 17, 2011 3:19 am Reply with quote

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
 
View user's profile Send private message Visit poster's website
montego
Site Admin



Joined: Aug 29, 2004
Posts: 9457
Location: Arizona

PostPosted: Sat Apr 23, 2011 11:04 am Reply with quote

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.

_________________
Where Do YOU Stand?
HTML Newsletter::ShortLinks::Mailer::Downloads and more... 
View user's profile Send private message Visit poster's website
doffer83







PostPosted: Sat Apr 23, 2011 1:05 pm Reply with quote

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
 
fkelly
Former Moderator in Good Standing



Joined: Aug 30, 2005
Posts: 3312
Location: near Albany NY

PostPosted: Sat Apr 23, 2011 2:35 pm Reply with quote

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.
 
View user's profile Send private message Visit poster's website
doffer83







PostPosted: Sat Apr 23, 2011 3:10 pm Reply with quote

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
Code:
[[:space:]] 
to the code but I dont know how, and would that be a security whole/probleem?

thank you again.
 
fkelly







PostPosted: Sun Apr 24, 2011 7:31 am Reply with quote

Well I googled "space character in ereg" and came up with this:

http://www.phpfreaks.com/forums/index.php?topic=219203.0

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.
 
hicuxunicorniobestbuildpc
The Mouse Is Extension Of Arm



Joined: Aug 13, 2009
Posts: 1122

PostPosted: Sun Apr 24, 2011 5:27 pm Reply with quote

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>";
 
View user's profile Send private message
fkelly







PostPosted: Sun Apr 24, 2011 5:57 pm Reply with quote

$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.
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> CNB Your Account

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©