From 7a5aa3c11d93595c0b9713c641be2e9026ef9ea3 Mon Sep 17 00:00:00 2001 From: Imran Remtulla Date: Sun, 7 Jan 2024 12:33:06 -0500 Subject: [PATCH 1/3] URL parsing bugfix for HTML source (#1253) --- lib/app_sources/html.dart | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/app_sources/html.dart b/lib/app_sources/html.dart index 45c2048..f63ecfe 100644 --- a/lib/app_sources/html.dart +++ b/lib/app_sources/html.dart @@ -17,13 +17,17 @@ String ensureAbsoluteUrl(String ambiguousUrl, Uri referenceAbsoluteUrl) { .split('/') .where((element) => element.trim().isNotEmpty) .toList(); + String absoluteUrl; if (ambiguousUrl.startsWith('/') || currPathSegments.isEmpty) { - return '${referenceAbsoluteUrl.origin}/$ambiguousUrl'; + absoluteUrl = '${referenceAbsoluteUrl.origin}/$ambiguousUrl'; } else if (ambiguousUrl.split('/').where((e) => e.isNotEmpty).length == 1) { - return '${referenceAbsoluteUrl.origin}/${currPathSegments.join('/')}/$ambiguousUrl'; + absoluteUrl = + '${referenceAbsoluteUrl.origin}/${currPathSegments.join('/')}/$ambiguousUrl'; } else { - return '${referenceAbsoluteUrl.origin}/${currPathSegments.sublist(0, currPathSegments.length - (currPathSegments.last.contains('.') ? 1 : 0)).join('/')}/$ambiguousUrl'; + absoluteUrl = + '${referenceAbsoluteUrl.origin}/${currPathSegments.sublist(0, currPathSegments.length - (currPathSegments.last.contains('.') ? 1 : 0)).join('/')}/$ambiguousUrl'; } + return Uri.parse(absoluteUrl).toString(); } int compareAlphaNumeric(String a, String b) { @@ -172,6 +176,8 @@ class HTML extends AppSource { ? element.text : (element.attributes['href'] ?? '').split('/').last)) .where((element) => element.key.isNotEmpty) + .map((e) => + MapEntry(ensureAbsoluteUrl(e.key, res.request!.url), e.value)) .toList(); if (allLinks.isEmpty) { allLinks = RegExp( From a9566f4b230abd82798132e76f950385c50325ca Mon Sep 17 00:00:00 2001 From: Imran Remtulla Date: Sun, 7 Jan 2024 12:34:09 -0500 Subject: [PATCH 2/3] Remove redundant function call --- lib/app_sources/html.dart | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/app_sources/html.dart b/lib/app_sources/html.dart index f63ecfe..e6e45ed 100644 --- a/lib/app_sources/html.dart +++ b/lib/app_sources/html.dart @@ -264,7 +264,6 @@ class HTML extends AppSource { additionalSettings['versionExtractWholePage'] == true ? res.body.split('\r\n').join('\n').split('\n').join('\\n') : rel); - rel = ensureAbsoluteUrl(rel, uri); version ??= (await checkDownloadHash(rel)).toString(); return APKDetails(version, [rel].map((e) => MapEntry(e, e)).toList(), AppNames(uri.host, tr('app'))); From 3092c854ffd769f28872c95131790a01aab14906 Mon Sep 17 00:00:00 2001 From: Imran Remtulla Date: Sun, 7 Jan 2024 12:36:20 -0500 Subject: [PATCH 3/3] Increment version --- lib/main.dart | 2 +- pubspec.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index 23779ad..3838981 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -19,7 +19,7 @@ import 'package:easy_localization/src/easy_localization_controller.dart'; // ignore: implementation_imports import 'package:easy_localization/src/localization.dart'; -const String currentVersion = '0.15.5'; +const String currentVersion = '0.15.6'; const String currentReleaseTag = 'v$currentVersion-beta'; // KEEP THIS IN SYNC WITH GITHUB RELEASES diff --git a/pubspec.yaml b/pubspec.yaml index 4f0a1e9..dcf20cb 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -17,7 +17,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # In Windows, build-name is used as the major, minor, and patch parts # of the product and file versions while build-number is used as the build suffix. -version: 0.15.5+241 # When changing this, update the tag in main() accordingly +version: 0.15.6+242 # When changing this, update the tag in main() accordingly environment: sdk: '>=3.0.0 <4.0.0'