From 676b2b9093ad6df18414219c926eeed5fd628488 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Tue, 2 May 2017 15:04:11 +0200 Subject: [PATCH] correct SPDX links when the License: tag contains a + The "+" is syntax on top of the license name: https://spdx.org/spdx-specification-21-web-version#h.jxpfx0ykyb60 --- .../org/fdroid/fdroid/views/AppDetailsRecyclerViewAdapter.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/src/main/java/org/fdroid/fdroid/views/AppDetailsRecyclerViewAdapter.java b/app/src/main/java/org/fdroid/fdroid/views/AppDetailsRecyclerViewAdapter.java index 8f96e178d..640476fa7 100644 --- a/app/src/main/java/org/fdroid/fdroid/views/AppDetailsRecyclerViewAdapter.java +++ b/app/src/main/java/org/fdroid/fdroid/views/AppDetailsRecyclerViewAdapter.java @@ -747,6 +747,9 @@ public class AppDetailsRecyclerViewAdapter // License link if (!TextUtils.isEmpty(app.license)) { String firstLicense = app.license.split(",")[0]; + if (firstLicense.endsWith("+")) { // the + is SPDX syntax on top of the license name + firstLicense = firstLicense.substring(0, firstLicense.length() - 1); + } String url = "https://spdx.org/licenses/" + firstLicense + ".html"; if (uriIsSetAndCanBeOpened(url)) { addLinkItemView(contentView, R.string.menu_license, R.drawable.ic_license, url, app.license);