Browse Source

Check if edited url has correct scheme

main
M66B 5 years ago
parent
commit
02de397be8
1 changed files with 5 additions and 0 deletions
  1. +5
    -0
      app/src/main/java/eu/faircode/email/FragmentMessage.java

+ 5
- 0
app/src/main/java/eu/faircode/email/FragmentMessage.java View File

@ -318,6 +318,11 @@ public class FragmentMessage extends FragmentEx {
public void onClick(DialogInterface dialog, int which) {
Uri uri = Uri.parse(etLink.getText().toString());
if (!"http".equals(uri.getScheme()) && !"https".equals(uri.getScheme())) {
Toast.makeText(getContext(), getString(R.string.title_no_viewer, uri.toString()), Toast.LENGTH_LONG).show();
return;
}
// https://developer.chrome.com/multidevice/android/customtabs
CustomTabsIntent.Builder builder = new CustomTabsIntent.Builder();
builder.setToolbarColor(Helper.resolveColor(getContext(), R.attr.colorPrimary));


Loading…
Cancel
Save