mirror of
https://codeberg.org/gitnex/GitNex
synced 2025-01-27 09:41:34 +01:00
Remove BOM, trim tokens, uname and url for logins (#1157)
As title. Got reports and this will fix the following issues: - Remove BOM - Remove new lines and spaces Co-authored-by: M M Arif <mmarif@swatian.com> Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/1157 Reviewed-by: qwerty287 <qwerty287@noreply.codeberg.org>
This commit is contained in:
parent
5bdbff4db6
commit
339a6655bf
@ -90,8 +90,8 @@ public class AddNewAccountActivity extends BaseActivity {
|
||||
|
||||
try {
|
||||
|
||||
String instanceUrlET = String.valueOf(viewBinding.instanceUrl.getText());
|
||||
String loginToken = String.valueOf(viewBinding.loginToken.getText());
|
||||
String instanceUrlET = String.valueOf(viewBinding.instanceUrl.getText()).replaceAll("[\\uFEFF|#]", "").trim();
|
||||
String loginToken = String.valueOf(viewBinding.loginToken.getText()).replaceAll("[\\uFEFF|#]", "").trim();
|
||||
String protocol = spinnerSelectedValue;
|
||||
|
||||
if(protocol == null) {
|
||||
|
@ -140,13 +140,13 @@ public class LoginActivity extends BaseActivity {
|
||||
return;
|
||||
}
|
||||
|
||||
String loginUid = loginUidET.getText().toString();
|
||||
String loginPass = loginPassword.getText().toString();
|
||||
String loginToken = loginTokenCode.getText().toString().trim();
|
||||
String loginUid = loginUidET.getText().toString().replaceAll("[\\uFEFF]", "").trim();
|
||||
String loginPass = loginPassword.getText().toString().trim();
|
||||
String loginToken = loginTokenCode.getText().toString().replaceAll("[\\uFEFF|#]", "").trim();
|
||||
|
||||
LoginType loginType = (loginMethod.getCheckedRadioButtonId() == R.id.loginUsernamePassword) ? LoginType.BASIC : LoginType.TOKEN;
|
||||
|
||||
URI rawInstanceUrl = UrlBuilder.fromString(UrlHelper.fixScheme(instanceUrlET.getText().toString(), "http")).toUri();
|
||||
URI rawInstanceUrl = UrlBuilder.fromString(UrlHelper.fixScheme(instanceUrlET.getText().toString().replaceAll("[\\uFEFF|#]", "").trim(), "http")).toUri();
|
||||
|
||||
instanceUrl = UrlBuilder.fromUri(rawInstanceUrl).withScheme(selectedProtocol.toLowerCase()).withPath(PathsHelper.join(rawInstanceUrl.getPath(), "/api/v1/"))
|
||||
.toUri();
|
||||
|
Loading…
x
Reference in New Issue
Block a user