"onClick=\"return openpopup('/mod/glossary/showentry.php?courseid=$courseid\&concept=$concept->concept', 'entry', 'menubar=0,location=0,scrollbars,resizable,width=600,height=450', 0);\">";
}
- $currentconcept = trim(strip_tags(str_replace("|", "\|", $concept->concept)));
- if ( !$concept->category ) {
- if ( $aliases = get_records("glossary_alias","entryid",$concept->id) ) {
- foreach ($aliases as $alias) {
- $currentconcept .= "|" . trim(strip_tags(str_replace("|", "\|", $alias->alias)));
+ $currentconcept = str_replace("|", "\|", $concept->concept);
+ $currentconcept = str_replace("'", "\'", $currentconcept);
+ if ( $currentconcept = trim(strip_tags($currentconcept)) ) {
+ if ( !$concept->category ) {
+ if ( $aliases = get_records("glossary_alias","entryid",$concept->id) ) {
+ foreach ($aliases as $alias) {
+ $currentconcept .= "|" . trim(strip_tags(str_replace("|", "\|", $alias->alias)));
+ }
}
}
+ $text = glossary_link_concepts($text,$currentconcept,$href_tag_begin, "</a>",$concept->casesensitive,$concept->fullmatch);
}
- $text = glossary_link_concepts($text,$currentconcept,$href_tag_begin, "</a>",$concept->casesensitive,$concept->fullmatch);
}
}
}
if ( $xmlglossary['NAME'][0]['#'] ) {
unset($glossary);
- $glossary->name = $xmlglossary['NAME'][0]['#'];
+ $glossary->name = addslashes(utf8_decode($xmlglossary['NAME'][0]['#']));
$glossary->course = $course->id;
$glossary->globalglossary = $xmlglossary['GLOBALGLOSSARY'][0]['#'];
- $glossary->intro = $xmlglossary['INTRO'][0]['#'];
+ $glossary->intro = addslashes(utf8_decode($xmlglossary['INTRO'][0]['#']));
$glossary->showspecial = $xmlglossary['SHOWSPECIAL'][0]['#'];
$glossary->showalphabet = $xmlglossary['SHOWALPHABET'][0]['#'];
$glossary->showall = $xmlglossary['SHOWALL'][0]['#'];
$xmlentry = $xmlentries[$i];
unset($newentry);
- $newentry->concept = $xmlentry['#']['CONCEPT'][0]['#'];
- $newentry->definition = $xmlentry['#']['DEFINITION'][0]['#'];
+ $newentry->concept = addslashes(utf8_decode($xmlentry['#']['CONCEPT'][0]['#']));
+ $newentry->definition = addslashes(utf8_decode($xmlentry['#']['DEFINITION'][0]['#']));
$permissiongranted = 1;
if ( $newentry->concept and $newentry->definition ) {