Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

- Link within link issue: Solved.

  • Loading branch information...
commit 1a1370bb0d038c898549271a2fbafa4e61a18545 1 parent 841da5f
willcast authored
Showing with 6 additions and 4 deletions.
  1. +6 −4 mod/glossary/dynalink.php
View
10 mod/glossary/dynalink.php
@@ -83,8 +83,9 @@ function glossary_link_concepts($text,$concept,$href_tag_begin,$href_tag_end = "
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);
@@ -105,8 +106,9 @@ function glossary_link_concepts($text,$concept,$href_tag_begin,$href_tag_end = "
$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);
}
Please sign in to comment.
Something went wrong with that request. Please try again.