Please login or register.

Login with username, password and session length
Advanced search  

News:

You need/want an older version of sNews ? Download an older/unsupported version here.

Author Topic: [FIX] for Clean Words function  (Read 3663 times)

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6020
  • Semantically Challenged
    • snews.ca
[FIX] for Clean Words function
« on: February 28, 2007, 08:13:49 pm »

If you have downlloaded the sNews 1.5.31 distribution package on or before February 21/07... you will need to add two lines into the following function.  They were in the 1.5.30 snews.php file (in this function) but... for some reason or other... they were inadvertently removed from 1.5.31's snews.php file. The two lines that need to be added are noted here in blue:
Quote
From snews.php, 1.5.30 version:
// CLEAN - WORD FILTER
function cleanWords($text) {
   if ((strtolower(s('word_filter_enable')) == 'on') && (file_exists(s('word_filter_file')))) {
      $bad_words_from_what = preg_replace('/(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+/', '', file(s('word_filter_file')));
      $bad_words_from_what = preg_replace('/^(.*)$/', '/\\1/i', $bad_words_from_what);

      $bad_words_to_what = s('word_filter_change');
      $text = preg_replace($bad_words_from_what, $bad_words_to_what, $text);
      return $text;
   } else {return $text;}
}

« Last Edit: August 21, 2007, 10:09:42 pm by Keyrocks »
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU