Skip to content

Commit

Permalink
MDL-83995 mod_glossary: support export/import of entry trusted text.
Browse files Browse the repository at this point in the history
  • Loading branch information
paulholden committed Dec 12, 2024
1 parent 02e8ceb commit 833cbe1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions mod/glossary/import.php
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,11 @@
throw new \moodle_exception('errorparsingxml', 'glossary');
}
$newentry->definition = trusttext_strip($definition);

if (isset($xmlentry['#']['DEFINITIONTRUST'][0]['#'])) {
$newentry->definitiontrust = !empty($xmlentry['#']['DEFINITIONTRUST'][0]['#']) && trusttext_trusted($context);
}

if ( isset($xmlentry['#']['CASESENSITIVE'][0]['#']) ) {
$newentry->casesensitive = $xmlentry['#']['CASESENSITIVE'][0]['#'];
} else {
Expand Down
1 change: 1 addition & 0 deletions mod/glossary/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -2363,6 +2363,7 @@ function glossary_generate_export_file($glossary, $ignored = "", $hook = 0) {
$co .= glossary_full_tag("CONCEPT",4,false,trim($entry->concept));
$co .= glossary_full_tag("DEFINITION",4,false,$entry->definition);
$co .= glossary_full_tag("FORMAT",4,false,$entry->definitionformat); // note: use old name for BC reasons
$co .= glossary_full_tag('DEFINITIONTRUST', 4, false, $entry->definitiontrust);
$co .= glossary_full_tag("USEDYNALINK",4,false,$entry->usedynalink);
$co .= glossary_full_tag("CASESENSITIVE",4,false,$entry->casesensitive);
$co .= glossary_full_tag("FULLMATCH",4,false,$entry->fullmatch);
Expand Down

0 comments on commit 833cbe1

Please sign in to comment.