From 34db7a98c31840218960a88e3fc14f213a2a915c Mon Sep 17 00:00:00 2001 From: dimkalinux Date: Wed, 7 Dec 2011 23:12:53 +0200 Subject: [PATCH] Fix censoring functions. Thanks to Gargaj for helping. --- include/functions.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/include/functions.php b/include/functions.php index 7c73e9b6..0872f327 100644 --- a/include/functions.php +++ b/include/functions.php @@ -844,7 +844,7 @@ function sef_friendly($str) // Replace censored words in $text loader function censor_words($text) { - global $forum_db; + global $forum_db, $forum_censors; $return = ($hook = get_hook('fn_censor_words_start')) ? eval($hook) : null; if ($return != null) @@ -876,10 +876,15 @@ function censor_words($text) // Replace censored words in $text 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)) {