From aaa08613554c4e86740567264db2aa1141947e10 Mon Sep 17 00:00:00 2001 From: Frode Petterson Date: Wed, 31 May 2017 09:33:10 +0200 Subject: [PATCH] Fix copyright not being display processes correctly HFP-1079 --- js/h5p.js | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/js/h5p.js b/js/h5p.js index 1b460c4..9c0846b 100644 --- a/js/h5p.js +++ b/js/h5p.js @@ -1254,15 +1254,12 @@ H5P.MediaCopyright = function (copyright, labels, order, extraFields) { */ var humanizeLicense = function (license, version) { var copyrightLicense = H5P.copyrightLicenses[license]; - if (copyrightLicense.label === undefined) { - return copyrightLicense; - } // Build license string var value = ''; if (!(license === 'PD' && version)) { // Add license label - value += (copyrightLicense.label ? copyrightLicense.label : copyrightLicense); + value += (copyrightLicense.hasOwnProperty('label') ? copyrightLicense.label : copyrightLicense); } // Check for version info @@ -1276,15 +1273,15 @@ H5P.MediaCopyright = function (copyright, labels, order, extraFields) { if (value) { value += ' '; } - value += (versionInfo.label ? versionInfo.label : versionInfo); + value += (versionInfo.hasOwnProperty('label') ? versionInfo.label : versionInfo); } // Add link if specified var link; - if (copyrightLicense.link) { + if (copyrightLicense.hasOwnProperty('link')) { link = copyrightLicense.link.replace(':version', copyrightLicense.linkVersions ? copyrightLicense.linkVersions[version] : version); } - else if (versionInfo && versionInfo.link) { + else if (versionInfo && copyrightLicense.hasOwnProperty('link')) { link = versionInfo.link } if (link) {