From: stronk7 Date: Thu, 27 May 2004 23:43:08 +0000 (+0000) Subject: Small change to make it a bit more consistent. No significant. X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=6bda940380999ef91d60b7ca94e00dc636937c86;p=moodle.git Small change to make it a bit more consistent. No significant. --- diff --git a/filter/activitynames/filter.php b/filter/activitynames/filter.php index d4f8e7e9b7..78c661f762 100644 --- a/filter/activitynames/filter.php +++ b/filter/activitynames/filter.php @@ -63,11 +63,13 @@ $regexp = '/'.$invalidprefixs.'('.$list_of_words_cp.')|('.$list_of_words_cp.')'.$invalidsufixs.'/is'; preg_match_all($regexp,$text,$list_of_words); - foreach (array_unique($list_of_words[0]) as $key=>$value) { - $words['<*'.$key.'*>'] = $value; - } - if (!empty($words)) { - $text = str_replace($words,array_keys($words),$text); + if ($list_of_words) { + foreach (array_unique($list_of_words[0]) as $key=>$value) { + $words['<*'.$key.'*>'] = $value; + } + if (!empty($words)) { + $text = str_replace($words,array_keys($words),$text); + } } //Now avoid searching inside the tag