Mysidia Adoptables Support Forum  

Home Community Mys-Script Creative Off-Topic
Go Back   Mysidia Adoptables Support Forum > Mysidia Adoptables > Questions and Supports

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 12-11-2012, 06:07 PM
Nieth's Avatar
Nieth Nieth is offline
Aspiring
 
Join Date: Dec 2012
Location: North Carolina
Posts: 154
Gender: Male
Credits: 11,044
Nieth is on a distinguished road
Send a message via MSN to Nieth
Default Accounts

Alright, quick question;

Is there a way to limit the characters on a the account creation in the Mysidia script? Because someone on our website made a username with a semi-colon in it and it looks like it's interfering with the script. When the user's name comes up in a friend request box or something like that, their name appears blank! As if there is nothing there.

So is there a way to fix this, or a way to limit what characters users are able to use when creating an account?
Reply With Quote
  #2  
Old 12-11-2012, 09:26 PM
Hall of Famer's Avatar
Hall of Famer Hall of Famer is offline
Administrator, Lead Coder
 
Join Date: Dec 2008
Location: South Brunswick
Posts: 4,448
Gender: Male
Credits: 334,022
Hall of Famer is on a distinguished road
Default

It is not difficult to fix. I dont wish to touch the UserValidator class though since its way too messy and likely to be replaced in future. For now, just go to register.php file and find this line:

PHP Code:
elseif($mysidia->input->action() == "register"){
  
// First of all, lets examine if the user register session is set
  
$mysidia->session->validate("register"); 
add below:

PHP Code:
$pattern '#^[A-Z0-9 ]+$#i';
if(!
preg_match ($pattern$mysidia->input->post("username"))){
    throw new 
Exception("Error: Invalid Username Specified, it can only contain alphanumeric characters and blank space!");    

__________________


Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site.
Reply With Quote
  #3  
Old 12-12-2012, 06:15 AM
Nieth's Avatar
Nieth Nieth is offline
Aspiring
 
Join Date: Dec 2012
Location: North Carolina
Posts: 154
Gender: Male
Credits: 11,044
Nieth is on a distinguished road
Send a message via MSN to Nieth
Default

Thanks Hall of Famer. Much appreciated.
Reply With Quote
  #4  
Old 12-12-2012, 12:16 PM
Hall of Famer's Avatar
Hall of Famer Hall of Famer is offline
Administrator, Lead Coder
 
Join Date: Dec 2008
Location: South Brunswick
Posts: 4,448
Gender: Male
Credits: 334,022
Hall of Famer is on a distinguished road
Default

No worries, glad it worked out. Thought it wouldnt be a long term solution to throw an exception like that, but for now its the easiest way to fix this thing up.
__________________


Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site.
Reply With Quote
  #5  
Old 12-12-2012, 12:44 PM
Nieth's Avatar
Nieth Nieth is offline
Aspiring
 
Join Date: Dec 2012
Location: North Carolina
Posts: 154
Gender: Male
Credits: 11,044
Nieth is on a distinguished road
Send a message via MSN to Nieth
Default

Yeah, the only thing wrong with it is that it leads to a white page with a 'fatal error' instead of appearing on the website, but it's alright for now.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Prevent people making multiple accounts kisazeky Addons/Mods Graveyard 6 04-24-2009 01:44 AM


All times are GMT -5. The time now is 11:24 AM.

Currently Active Users: 9769 (0 members and 9769 guests)
Threads: 4,080, Posts: 32,024, Members: 2,016
Welcome to our newest members, jolob.
BETA





What's New?

What's Hot?

What's Popular?


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
vBCommerce I v2.0.0 Gold ©2010, PixelFX Studios
vBCredits I v2.0.0 Gold ©2010, PixelFX Studios
Emoticons by darkmoon3636