]> git.mjollnir.org Git - moodle.git/commitdiff
Small change to make it a bit more consistent. No significant.
authorstronk7 <stronk7>
Thu, 27 May 2004 23:43:08 +0000 (23:43 +0000)
committerstronk7 <stronk7>
Thu, 27 May 2004 23:43:08 +0000 (23:43 +0000)
filter/activitynames/filter.php

index d4f8e7e9b7d252cf9756b58255f1b10e280e86ad..78c661f76299a1881a6dc3d389b982126dcd9eee 100644 (file)
         $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 <nolink>tag