Fix h5p.json title field htmlencoded

HFP-2095-Fix-table-styling
Frode Petterson 2018-10-05 15:14:47 +02:00
parent 9081ca3128
commit 06985cca7c
1 changed files with 11 additions and 1 deletions

View File

@ -1598,6 +1598,16 @@ Class H5PExport {
$this->h5pC = $H5PCore;
}
/**
* Reverts the replace pattern used by the text editor
*
* @param string $value
* @return string
*/
private static function revertH5PEditorTextEscape($value) {
return str_replace('&lt;', '<', str_replace('&gt;', '>', str_replace('&#039;', "'", str_replace('&quot;', '"', $value))));
}
/**
* Return path to h5p package.
*
@ -1630,7 +1640,7 @@ Class H5PExport {
// Build h5p.json, the en-/de-coding will ensure proper escaping
$h5pJson = array (
'title' => $content['title'],
'title' => self::revertH5PEditorTextEscape($content['title']),
'language' => (isset($content['language']) && strlen(trim($content['language'])) !== 0) ? $content['language'] : 'und',
'mainLibrary' => $content['library']['name'],
'embedTypes' => $embedTypes