diff --git a/mod/glossary/filter.php b/mod/glossary/filter.php index 68897947a43..06edbcb0997 100644 --- a/mod/glossary/filter.php +++ b/mod/glossary/filter.php @@ -155,6 +155,17 @@ } } + //Avoid searching within the document head + $head = array(); + preg_match_all('/
(.+?)<\/head>/is',$text,$list_of_heads); + foreach (array_unique($list_of_heads[0]) as $key=>$value) { + $head['<~'.$key.'~>'] = $value; + } + if (!empty($head)) { + $text = str_replace($head,array_keys($head),$text); + } + + //Now avoid searching inside the