- Link within link issue: Solved.
authorwillcast <willcast>
Wed, 15 Oct 2003 22:01:12 +0000 (22:01 +0000)
committerwillcast <willcast>
Wed, 15 Oct 2003 22:01:12 +0000 (22:01 +0000)
mod/glossary/dynalink.php

index 010ef9b2e71c9553d634069891a24bcc25f62336..7b722da216448891ad65f257a4e2ce7b1096c7a2 100644 (file)
@@ -83,8 +83,9 @@
         foreach (array_unique($list_of_links[0]) as $key=>$value) {
             $links['<|*'.$key.'*|>'] = $value;
         }
-        $text = str_replace($links,array_keys($links),$text);
-
+               if ( $links ) {
+            $text = str_replace($links,array_keys($links),$text);
+        }
         // getting ride of all other tahs
         $final = array();
         preg_match_all('/<(.+?)>/is',$text,$list_of_words);
 
         $text = eregi_replace("$list_of_words_cp", "$href_tag_begin"."\\1"."$href_tag_end", $text);
         $text = str_replace(array_keys($final),$final,$text);
-        $text = str_replace(array_keys($links),$links,$text);
-
+               if ( $links ) {
+            $text = str_replace(array_keys($links),$links,$text);
+        }
         return stripslashes($text);
     }