Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 02-24-2013, 04:29 PM   PM User | #1
JST2CRZY
New to the CF scene

 
Join Date: Feb 2013
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
JST2CRZY is an unknown quantity at this point
bad words filter code change

Hi, this my first post. Hope this is in the right section. I have Flashchat 4.7.12 integrated with a phpbb forum. I cannot access the chat admin panel so most changes are made via code change. I am trying to disable the entire bad words function (want to allow every word) but not sure if the whole file can be deleted without altering any other files?
Here are the first three lines in badword.php and there are 10 other words below these (some don't have the =>):


$GLOBALS['fc_config']['badWordSubstitute'] = '#$%^&*';
$GLOBALS['fc_config']['badWords'] = array(
'asses' => 'arses',

I tried changing arses to asses but nothing changed. What am I missing?

Last edited by JST2CRZY; 02-24-2013 at 04:45 PM..
JST2CRZY is offline   Reply With Quote
Old 02-24-2013, 04:40 PM   PM User | #2
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,751
Thanks: 4
Thanked 2,468 Times in 2,437 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
Being unfamiliar with the system itself I cannot tell you how that config works with the key => value pairs especially given that both the key and value are near identical.
Replacement for language filters typically work via regex to bind part or whole words. For example, you don't want to block the word 'assimilate', so preg is used to bind the "bad word" in there as a word of its own instead of a partial.

If you want to remove the filter completely using code itself, my suggestion is to simply block comment out the $GLOBALS['fc_config']['badWords'] array, and add a simple $GLOBALS['fc_config']['badWords'] = array();. That would (logically) tell me that it is searching for no bad words to replace.

I cannot really comment on the use of the scope though since I don't know the context that these are in. Typically global and $GLOBALS should be avoided as they are debugging nightmares.
__________________
PHP Code:
header('HTTP/1.1 420 Enhance Your Calm'); 
Fou-Lu is offline   Reply With Quote
Old 02-24-2013, 05:28 PM   PM User | #3
JST2CRZY
New to the CF scene

 
Join Date: Feb 2013
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
JST2CRZY is an unknown quantity at this point
What exactly do you mean by "block comment out" I am very new to this so I just need some clarification.
Thanks
JST2CRZY is offline   Reply With Quote
Old 02-24-2013, 05:30 PM   PM User | #4
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,751
Thanks: 4
Thanked 2,468 Times in 2,437 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
/* ... */ is a block comment. So with what you have here:
PHP Code:
$GLOBALS['fc_config']['badWords'] = array(
'asses' => 'arses',
...
); 
Would become:
PHP Code:
/*
$GLOBALS['fc_config']['badWords'] = array(
'asses' => 'arses',
...
);
*/
$GLOBALS['fc_config']['badWord'] = array(); 
Which if it works like it logically appears to, should search for no words to replace.
__________________
PHP Code:
header('HTTP/1.1 420 Enhance Your Calm'); 
Fou-Lu is offline   Reply With Quote
Old 02-24-2013, 09:46 PM   PM User | #5
JST2CRZY
New to the CF scene

 
Join Date: Feb 2013
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
JST2CRZY is an unknown quantity at this point
Unfortunately, this did not work but thanks anyway.
JST2CRZY is offline   Reply With Quote
Old 02-24-2013, 11:00 PM   PM User | #6
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,751
Thanks: 4
Thanked 2,468 Times in 2,437 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
Afraid we can't really help then. You'll need to get in touch with the developers about how to config the filters.
__________________
PHP Code:
header('HTTP/1.1 420 Enhance Your Calm'); 
Fou-Lu is offline   Reply With Quote
Old 02-25-2013, 05:07 AM   PM User | #7
c1lonewolf
Regular Coder

 
Join Date: Sep 2002
Posts: 230
Thanks: 0
Thanked 11 Times in 11 Posts
c1lonewolf is an unknown quantity at this point
That array could be just a configuration setup array for the system, I would look for a file that contains profanity with a comma separator. The original array is probably overwritten by a new one if the 'profanity' file is available, which is why the former code would not work.
__________________
NO Limits!!
c1lonewolf is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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


All times are GMT +1. The time now is 08:13 PM.


Advertisement
Log in to turn off these ads.