PDA

View Full Version : Restrict Thread Titles to Alpha-Numeric only


Snowhog
12-21-2016, 08:13 PM
I'm looking for a MOD that restricts Thread Titles to ONLY alpha (a-z (upper/lower)) and/or numeric (0-9) characters. Why? To prevent the creation of potential SQL injection strings.

We use ZB Block on our Forum, and it's been tremendously effective in keeping spam and spammers out. However, many of our members create Thread Titles using error output (as that's the problem they want to address). Sometimes these titles can be seen by ZB Block (via external search (and on rare occasion, internal search) queries, or by Moderator/Administrator merge actions, as SQL Injection attempts.

By restricting Thread Title characters to alpha-numeric only, we avoid this potential problem.

MarkFL
12-22-2016, 06:28 AM
Try the simple product I have attached. Let me know if you want any changes. :)

Snowhog
12-22-2016, 05:29 PM
Downloaded and installed. Will test it and report back.

Snowhog
12-22-2016, 05:41 PM
Well, my first test post allowed non-alphanumeric characters in the Thread Title.

MarkFL
12-22-2016, 05:49 PM
This is what I get if I try to save/edit a post/thread to use a title having non-alphanumeric characters in the title:

https://vborg.vbsupport.ru/attachment.php?attachmentid=155589&stc=1&d=1482435984

I'd have to come to your site with an admin account to figure out why it's not working on your site. SO, if you so desire, send by PM the login credentials to an admin account on your site and I'll see if I can find out why.

Snowhog
12-22-2016, 06:56 PM
Thank you for your assistance, both in making this MOD (Plugin) and for helping to troubleshoot why it isn't working "here".

For others reading this, I tested this MOD using Apple's Safari browser on my iMac running macOS Sierra (latest/greatest, fully up to date). Using Safari, Thread Titles allows non-alphanumeric characters. But, using Firefox on my Linux OS laptop, this MOD works as designed.

So, Safari chooses 'not to play well with others' it seems. ;)

MarkFL
12-22-2016, 07:10 PM
Yes, Safari is one of a few browsers that don't yet support form validation it seems. So, I'll add a fallback method of some sort and post back when I have something for you to test. :)

MarkFL
12-23-2016, 10:01 AM
I have posted an update to this product here:

Thread/Post Title Characters (https://vborg.vbsupport.ru/showthread.php?t=324059)

I've cited you as a co-author since this was your idea/request. :)

Snowhog
12-23-2016, 07:00 PM
I've cited you as a co-author since this was your idea/request. :)

Wow. Thank you for the recognition. I'll download and install the update a little later today and report back on how it fares with Safari.

Snowhog
12-23-2016, 07:41 PM
Tested in our Forum using Apple Safari browser. It works! :happy_dance:

MarkFL
12-23-2016, 07:44 PM
You may want to add the line:

margin-top: 1em;

to the message CSS in the product settings to give some space above the message. :) Thanks for letting me know it works! :)

Snowhog
12-23-2016, 08:05 PM
Where in the Message CSS?

MarkFL
12-23-2016, 10:04 PM
Where in the Message CSS?

Anywhere would be fine...I would put it on a separate line, although even that's not necessary. :D