Skip to content

Commit

Permalink
[BUGFIX] Fix metadata processing in exportFile
Browse files Browse the repository at this point in the history
  • Loading branch information
liayn committed Sep 11, 2023
1 parent 595acc7 commit 732f54f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion h5p.classes.php
Original file line number Diff line number Diff line change
Expand Up @@ -1886,7 +1886,7 @@ public function createExportFile($content) {

foreach(['authors', 'source', 'license', 'licenseVersion', 'licenseExtras' ,'yearFrom', 'yearTo', 'changes', 'authorComments', 'defaultLanguage'] as $field) {
if (isset($content['metadata'][$field]) && $content['metadata'][$field] !== '') {
if (($field !== 'authors' && $field !== 'changes') || (count($content['metadata'][$field]) > 0)) {
if (($field !== 'authors' && $field !== 'changes') || (count((array)$content['metadata'][$field]) > 0)) {
$h5pJson[$field] = json_decode(json_encode($content['metadata'][$field]));
}
}
Expand Down

0 comments on commit 732f54f

Please sign in to comment.