Skip to content

Commit

Permalink
fix:default license version 4.0 if values are unset
Browse files Browse the repository at this point in the history
  • Loading branch information
torsten-simon committed Nov 26, 2024
1 parent d6dfad9 commit dad0e68
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import org.edu_sharing.repository.tools.URLHelper;

public class LicenseService {

private static String DEFAULT_LICENSE_VERSION = "4.0";
public String getIconUrl(String license,boolean dynamic){
if(license==null || license.isEmpty())
license="none";
Expand Down Expand Up @@ -58,7 +58,7 @@ public String getLicenseUrl(String license, String locale, String version){
}

if(result != null){
version = (version == null) ? "3.0" : version;
version = (version == null) ? DEFAULT_LICENSE_VERSION : version;
if(result.contains("${version}")){
result = result.replace("${version}", version);
}
Expand All @@ -71,5 +71,5 @@ public String getLicenseUrl(String license, String locale, String version){

return result;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ export class LicenseDetailsComponent implements OnChanges {
if (license.indexOf('ND') !== -1) this.ccShare = 'ND';
if (license.indexOf('NC') !== -1) this.ccCommercial = 'NC';

this.ccVersion = this.getValueForAll(
RestConstants.CCM_PROP_LICENSE_CC_VERSION,
this.ccVersion,
);
this.ccCountry = this.getValueForAll(RestConstants.CCM_PROP_LICENSE_CC_LOCALE);
// also see @LicenseService
this.ccVersion =
this.getValueForAll(RestConstants.CCM_PROP_LICENSE_CC_VERSION, this.ccVersion) ||
'4.0';
this.ccCountry = this.getValueForAll(RestConstants.CCM_PROP_LICENSE_CC_LOCALE) || 'DE';
}
if (license === 'CC_0') {
this.type = 'CC_0';
Expand Down

0 comments on commit dad0e68

Please sign in to comment.