Topics

User Functions

Events

There are no upcoming events

What's New

Stories

No new stories

Comments last 2 weeks

No new comments

Trackbacks last 2 weeks

No new trackback comments

Links last 2 weeks

No recent new links

NEW FILES last 14 days

No new files

Welcome to Geeklog Saturday, May 18 2013 @ 04:38 PM EDT


 Forum Index > Extensions > Cool Hacks New Topic Post Reply
 Username VS spaces (and other characters)
   
tmarquez
 11/23/06 08:50PM (Read 1295 times)  
++++-
Regular Poster

Status: offline


Registered: 06/17/03
Posts: 70
Call me anal, but I can not stand usernames with spaces. Obviously, they're not a problem for GeekLog, but I often find my sites users can NOT remember their usernames when they use spaces. So, after much searching through the forums, I decided to put this little hack up. This one line of code tests the $username in the file users.php to make sure it doesn't have any spaces or any other nasty characters.

In users.php find this line of code on line 467:

PHP Formatted Code

    if (empty ($username)) {
 


Replace with:

PHP Formatted Code
 
if (empty ($username) || preg_match('~[<>&"\'=\\\]|[[:space:]]~', $username)) {
 



NOTE: Remember to always back up files before attempting these hacks.

T.Marquez Jr. - Webmaster - www.indianapolisfilm.net - Geeklog 1.4.0sr5-1
 
Profile Email Website
 Quote
Content generated in: 0.43 seconds
New Topic Post Reply

Normal Topic Normal Topic
Sticky Topic Sticky Topic
Locked Topic Locked Topic
New Post New Post
Sticky Topic W/ New Post Sticky Topic W/ New Post
Locked Topic W/ New Post Locked Topic W/ New Post
View Anonymous Posts 
Able to post 
Filtered HTML Allowed 
Censored Content