mirror of
https://github.com/M66B/FairEmail.git
synced 2025-12-24 11:12:54 +01:00
Check if link title has valid parent domain
This commit is contained in:
@@ -171,9 +171,11 @@ public class FragmentDialogOpenLink extends FragmentDialogBase {
|
||||
|
||||
// Process title
|
||||
final Uri uriTitle;
|
||||
if (title != null && PatternsCompat.WEB_URL.matcher(title).matches())
|
||||
uriTitle = Uri.parse(title.contains("://") ? title : "http://" + title);
|
||||
else
|
||||
if (title != null && PatternsCompat.WEB_URL.matcher(title).matches()) {
|
||||
Uri u = Uri.parse(title.contains("://") ? title : "http://" + title);
|
||||
String host = u.getHost(); // Capture1.PNG
|
||||
uriTitle = (UriHelper.hasParentDomain(context, host) ? u : null);
|
||||
} else
|
||||
uriTitle = null;
|
||||
|
||||
// Get views
|
||||
|
||||
Reference in New Issue
Block a user