This is the community forum. For a developer response use the Client Area.
Follow us on Facebook, Twitter and YouTube!

bad word wildcard
#1

Hi Steven

Congratulations to version 1.8... it just gets better and better.

Q; would it be possible to use the 'wildcard' principle in the bad words list, like; wob* ?

YKS
Norbs
Reply
#2

Hi,

I've done only a few tests so make sure to test it yourself as well.

In /comments/includes/functions/processor.php, find the function cmtx_check_for_word (line 421).

Inside that function, there is this:

PHP Code:
<?php 
$word
= preg_quote($word, '/'); //escape any special characters

Add this on the line after:

PHP Code:
<?php 
$word
= str_ireplace("\*", ".*", $word);

Example:

Bad word: Newcastle

Test word: New (Not found)
Test word: New* (Found)
Test word: castle (Not found)
Test word: *castle (Found)
Test word: cast (Not Found)
Test word: *cast* (Found)

Have you completed the interview?
Reply
#3

cool, I'll run this, TKS Steven

BTW, man, the improvements - fantastic. And, - styling the entire commentics form is a breeze now ... took me 15 minutes (maybe another 15 if I wanted to go crazy on it ;-) ) BRAVO!
Reply
#4

Okay please let me know if it works.

I'm glad you like the latest version. What improvements did you like the most?

Have you completed the interview?
Reply
#5
Wink 

(28-Apr-2012, 09:29 PM)Steven Wrote:  Okay please let me know if it works.

I'm glad you like the latest version. What improvements did you like the most?
Will do, still setting everything up for the new site... can I post it here?

What did I like most? Everything and a lot, but to name just a few...
1.
I feel you did a heck of a job in (cleaning) the PHP, it's so much easier to apply any changes...
2. which helps also to apply any CSS changes (no need to dig into PHP so much as in the early version)
3.
Remember my problem I had renaming the root folder /comments/ ? WOW, it was just a breeze this time, 1-2-3 done.
4.
adding the choices for email methods!
5.
include the Rich Snippets - just activate it in admin? Great!

The list could go on, Steven. I wish I could find a PHP programmer of your calibre for all my other work! (where are they?)

As said, excellent work and... BTW...
SECURITY !!! You have no idea how many "bad folks" your script keeps off my neck, every day... love it. Soon the UA will run out of IP addresses to hit on me, I guess

Have a nice Sunday!
Reply
#6

Hi Steven, after I added that line of code, the entire comment section did not show at all (usually aPHP parsing error, right?)

BTW, you use secureimage captcha?
I tired to implement the same captcha on my contact forms but could not get the validation going. (sure just my poor PHP skills and I added it at the wrong place of my Formprocess.php, I guess? Any other idea?
Reply
#7

Hi,

Yes it's likely to be a PHP parsing error. Are there any error messages displayed or logged?

There can be many reasons why the secureimage captcha always fails. In the next version it will be replaced with ReCaptcha. Reasons can include:

- JavaScript not being enabled
- Cookies not being enabled
- No session (check session_start(); is at the top of the file)

This FAQ may help:
http://www.phpcaptcha.org/faq/#incorrect_code

Have you completed the interview?
Reply
#8

You misunderstood, "your" captcha is working perfectly
(errr, I don't like recaptcha at all, personally I think secureimage is much better, besides I cannot see one single reason why that recaptcha thing need to be huge that it almost fills an entire site.. ;-) ) Better stick with secureimage!

No, what I meant is - I tried to add secureimage to my contact form (nothing to to with commentice), and it worked, - the image showed but I could not get the "validation" going (I must have placed the validation part at the wrong places within the "forsend.php")
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)