Skip to content
Browse files

Small change to make it a bit more consistent. No significant.

  • Loading branch information...
1 parent f878539 commit 6bda940380999ef91d60b7ca94e00dc636937c86 stronk7 committed May 27, 2004
Showing with 7 additions and 5 deletions.
  1. +7 −5 filter/activitynames/filter.php
View
12 filter/activitynames/filter.php
@@ -63,11 +63,13 @@ function activity_link_names($text,$name,$href_tag_begin,$href_tag_end = "</a>")
$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

0 comments on commit 6bda940

Please sign in to comment.
Something went wrong with that request. Please try again.