Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    New to the CF scene
    Join Date
    Feb 2013
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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.

  • #2
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,979
    Thanks
    4
    Thanked 2,659 Times in 2,628 Posts
    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'); 

  • #3
    New to the CF scene
    Join Date
    Feb 2013
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    What exactly do you mean by "block comment out" I am very new to this so I just need some clarification.
    Thanks

  • #4
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,979
    Thanks
    4
    Thanked 2,659 Times in 2,628 Posts
    /* ... */ 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'); 

  • #5
    New to the CF scene
    Join Date
    Feb 2013
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Unfortunately, this did not work but thanks anyway.

  • #6
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,979
    Thanks
    4
    Thanked 2,659 Times in 2,628 Posts
    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'); 

  • #7
    Regular Coder
    Join Date
    Sep 2002
    Posts
    429
    Thanks
    0
    Thanked 20 Times in 20 Posts
    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!! www.dhcreationstation.com
    ------------------------------------------------------------
    Broken items wanted for tinkerin'! PostItNow@BrokenEquipment.com


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •