fix: resolved potential issues related to missing or invalid prefixes

This commit is contained in:
antonio 2023-06-23 18:23:44 +02:00
parent 663285611b
commit 34fa2f456e
2 changed files with 6 additions and 0 deletions

View file

@ -116,6 +116,11 @@ public class ServerSignupDialog extends DialogFragment {
return false; return false;
} }
if (!server.matches("^https?://(.*)")) {
bind.serverTextView.setError(getString(R.string.error_server_prefix));
return false;
}
return true; return true;
} }

View file

@ -52,6 +52,7 @@
<string name="download_title_section">Downloads</string> <string name="download_title_section">Downloads</string>
<string name="empty_string" /> <string name="empty_string" />
<string name="error_required">Required</string> <string name="error_required">Required</string>
<string name="error_server_prefix">http or https prefix required</string>
<string name="exo_download_notification_channel_name">Downloads</string> <string name="exo_download_notification_channel_name">Downloads</string>
<string name="filter_info_selection">Select two or more filters</string> <string name="filter_info_selection">Select two or more filters</string>
<string name="filter_title">Filter</string> <string name="filter_title">Filter</string>