mirror of
https://github.com/nextcloud/android.git
synced 2024-11-27 09:39:25 +03:00
Merge pull request #1119 from owncloud/strip-index-php-from-server-url
Strip away index.php/apps/files to allow copy pasting from the server
This commit is contained in:
commit
08be3d3433
1 changed files with 14 additions and 1 deletions
|
@ -742,7 +742,7 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
|
|||
mOAuthTokenEndpointText.getText().toString().trim());
|
||||
|
||||
getServerInfoIntent.putExtra(
|
||||
OperationsService.EXTRA_OAUTH2_QUERY_PARAMETERS,
|
||||
OperationsService.EXTRA_OAUTH2_QUERY_PARAMETERS,
|
||||
queryParameters);
|
||||
|
||||
if (mOperationsServiceBinder != null) {
|
||||
|
@ -801,6 +801,8 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
|
|||
showRefreshButton(false);
|
||||
|
||||
if (uri.length() != 0) {
|
||||
uri = stripIndexPhpOrAppsFiles(uri, mHostUrlInput);
|
||||
|
||||
// Handle internationalized domain names
|
||||
uri = DisplayUtils.convertIdn(uri, true);
|
||||
|
||||
|
@ -1143,6 +1145,17 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
|
|||
return url;
|
||||
}
|
||||
|
||||
private String stripIndexPhpOrAppsFiles(String url, EditText mHostUrlInput) {
|
||||
if (url.endsWith("/index.php")) {
|
||||
url = url.substring(0, url.lastIndexOf("/index.php"));
|
||||
mHostUrlInput.setText(url);
|
||||
} else if (url.contains("/index.php/apps/")) {
|
||||
url = url.substring(0, url.lastIndexOf("/index.php/apps/"));
|
||||
mHostUrlInput.setText(url);
|
||||
}
|
||||
|
||||
return url;
|
||||
}
|
||||
|
||||
// TODO remove, if possible
|
||||
private String trimUrlWebdav(String url){
|
||||
|
|
Loading…
Reference in a new issue