Skip to content

Commit

Permalink
Fix censoring functions. Thanks to Gargaj for helping.
Browse files Browse the repository at this point in the history
  • Loading branch information
dimkalinux committed Dec 7, 2011
1 parent 1427a3f commit 34db7a9
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions include/functions.php
Expand Up @@ -844,7 +844,7 @@ function sef_friendly($str)
// Replace censored words in $text loader // Replace censored words in $text loader
function censor_words($text) function censor_words($text)
{ {
global $forum_db; global $forum_db, $forum_censors;


$return = ($hook = get_hook('fn_censor_words_start')) ? eval($hook) : null; $return = ($hook = get_hook('fn_censor_words_start')) ? eval($hook) : null;
if ($return != null) if ($return != null)
Expand Down Expand Up @@ -876,10 +876,15 @@ function censor_words($text)
// Replace censored words in $text // Replace censored words in $text
function censor_words_do($forum_censors, $text, $unicode) function censor_words_do($forum_censors, $text, $unicode)
{ {
static $search_for, $replace_with; static $search_for = NULL;
static $replace_with = NULL;

if (is_null($search_for))
$search_for = array();

if (is_null($replace_with))
$replace_with = array();


$search_for = array();
$replace_with = array();


if (!empty($forum_censors)) if (!empty($forum_censors))
{ {
Expand Down

0 comments on commit 34db7a9

Please sign in to comment.