Wedge

Public area => The Pub => Plugins => Topic started by: txcas on February 6th, 2014, 11:47 PM

Title: Plugin suggestion - Prevent ALL CAPS
Post by: txcas on February 6th, 2014, 11:47 PM
IT WOULD BE NICE TO HAVE A PLUGIN THAT WOULD PREVENT THIS.  I hate it when some users use all caps.
Title: Re: Plugin suggestion - Prevent ALL CAPS
Post by: Bunstonious on February 6th, 2014, 11:48 PM
+1
Title: Re: Plugin suggestion - Prevent ALL CAPS
Post by: Nao on February 6th, 2014, 11:52 PM
I believe it's already available in the Moderation Filter area... ;)
Not 100% sure, but Pete mentioned working on that at one point.
Title: Re: Plugin suggestion - Prevent ALL CAPS
Post by: Pandos on February 6th, 2014, 11:54 PM
Yes it is :)
But there's an error:
This rule could not be saved, there was something wrong in sending the data. Please go back and try again.


It's impossible to add a rule. :(
Title: Re: Plugin suggestion - Prevent ALL CAPS
Post by: Nao on February 7th, 2014, 12:04 AM
Oh, bugger... Any rule?

I have rules on wedge.org... How did I manage to add them, them..? :^^;:
Title: Re: Plugin suggestion - Prevent ALL CAPS
Post by: txcas on February 7th, 2014, 12:12 AM
I am able to save filter rules on my test site, but I have not found a rule that prevents all caps.  I did find a Topics setting that prevents all caps in the subject after certain % of characters.  I don't think that is working.
Title: Re: Plugin suggestion - Prevent ALL CAPS
Post by: Pandos on February 7th, 2014, 12:17 AM
Quote from Nao on February 7th, 2014, 12:04 AM
Oh, bugger... Any rule?

I have rules on wedge.org... How did I manage to add them, them..? :^^;:
Updating to the newest version. Will report in a view minutes...
Title: Re: Plugin suggestion - Prevent ALL CAPS
Post by: Pandos on February 7th, 2014, 12:24 AM
Nope. Error is still there.
Error log is not that helpful:
 /index.php?action=admin;area=modfilters;sa=save(http://192.168.70.13/index.php?action=admin;area=modfilters;sa=save)
 This rule could not be saved, there was something wrong in sending the data. Please go back and try again.
Title: Re: Plugin suggestion - Prevent ALL CAPS
Post by: Nao on February 7th, 2014, 12:27 AM
And of course, that error message is sent on 9 different places in the ManageModeration code... Nice, it'll make it so easy to trace... ::)
Title: Re: Plugin suggestion - Prevent ALL CAPS
Post by: Pandos on February 7th, 2014, 12:30 AM
Take your time, take a bit of sleep and get well soon  :thanks:
Title: Re: Plugin suggestion - Prevent ALL CAPS
Post by: Nao on February 7th, 2014, 12:31 AM
Not a very good day for me... But my health has been failing me these last couple of weeks. I should be consulting but my doctor's queue waiting time is usually > 1 hour, and I don't have time to 'waste' on that.
Title: Re: Plugin suggestion - Prevent ALL CAPS
Post by: txcas on February 7th, 2014, 12:38 AM
Quote from Pandos on February 7th, 2014, 12:24 AM
Nope. Error is still there.
Error log is not that helpful:
 /index.php?action=admin;area=modfilters;sa=save(http://192.168.70.13/index.php?action=admin;area=modfilters;sa=save)
 This rule could not be saved, there was something wrong in sending the data. Please go back and try again.
Pandos I can save rules.  If you send me the rule parameters you are using I can try to repro on my site.
Title: Re: Plugin suggestion - Prevent ALL CAPS
Post by: Pandos on February 7th, 2014, 12:43 AM
Quote from txcas on February 7th, 2014, 12:38 AM
Pandos I can save rules.  If you send me the rule parameters you are using I can try to repro on my site.
It stops right before I can create a new rule. Just by select the conditions :)
Title: Re: Plugin suggestion - Prevent ALL CAPS
Post by: Nao on February 7th, 2014, 02:37 PM
I'm having no problems on my side either.
Any posts, body contents, [A-Z]{6,}, case-sensitive, save... Done.

BTW, there really isn't an all-caps filter, out of the box. The one I gave above is really limited. I guess it's plugin material, then... :-/
Title: Re: Plugin suggestion - Prevent ALL CAPS
Post by: Pandos on February 7th, 2014, 03:01 PM
Perhaps it's due to my PHP version 5.4?
Hmm.. Will investigate in this.
Title: Re: Plugin suggestion - Prevent ALL CAPS
Post by: Nao on February 7th, 2014, 03:15 PM
Nope, tested here (5.3) and on local (5.5)...
Title: Re: Plugin suggestion - Prevent ALL CAPS
Post by: txcas on March 18th, 2014, 10:22 PM
Quote from Nao on February 7th, 2014, 02:37 PM
I'm having no problems on my side either.
Any posts, body contents, [A-Z]{6,}, case-sensitive, save... Done.

BTW, there really isn't an all-caps filter, out of the box. The one I gave above is really limited. I guess it's plugin material, then... :-/
I tried this filter and it did nothing for me.  All Caps still come through.
Title: Re: Plugin suggestion - Prevent ALL CAPS
Post by: Nao on March 20th, 2014, 06:04 PM
Hmm, how could we do that... Maybe just do a temp preg_replace (in the post code) that removes all [^a-zA-Z] characters, and then determines whether the resulting string is ~^[A-Z]+$~..? Also make sure not to test on posts that are less than 100 chars long or something... (SO THAT I CAN SCREAM FOR FUN AND STILL NOT BE REJECTED, AH AH!!!!!!)