Strip spaces from link titles for URL check

This commit is contained in:
M66B 2021-08-17 13:30:47 +02:00
parent 2d7233eced
commit 81d9d46174
1 changed files with 2 additions and 1 deletions

View File

@ -172,7 +172,8 @@ public class FragmentDialogOpenLink extends FragmentDialogBase {
// Process title
final Uri uriTitle;
if (title != null && PatternsCompat.WEB_URL.matcher(title).matches()) {
Uri u = Uri.parse(title.contains("://") ? title : "http://" + title);
String t = title.replaceAll("\\s+", "");
Uri u = Uri.parse(title.contains("://") ? t : "http://" + t);
String host = u.getHost(); // Capture1.PNG
uriTitle = (UriHelper.hasParentDomain(context, host) ? u : null);
} else