F-Droid: Don't pull changelog text if it isn't a raw file from GitHub/GitLab (#1340)

This commit is contained in:
Imran Remtulla
2024-01-27 21:01:44 -05:00
parent d25895fa28
commit 5a8efa2388
2 changed files with 36 additions and 9 deletions

View File

@@ -358,6 +358,16 @@ class AppsPageState extends State<AppsPage> {
String? changesUrl =
appSource.changeLogPageFromStandardUrl(listedApps[appIndex].app.url);
String? changeLog = listedApps[appIndex].app.changeLog;
if (changeLog?.split('\n').length == 1) {
if (RegExp(
'(http|ftp|https)://([\\w_-]+(?:(?:\\.[\\w_-]+)+))([\\w.,@?^=%&:/~+#-]*[\\w@?^=%&/~+#-])?')
.hasMatch(changeLog!)) {
if (changesUrl == null) {
changesUrl = changeLog;
changeLog = null;
}
}
}
return (changeLog == null && changesUrl == null)
? null
: () {