projects
/
pub
/
Android
/
ownCloud.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
eac77d8
)
Filter dots at the beginning of the url
author
masensio
<masensio@solidgear.es>
Tue, 21 Apr 2015 11:50:13 +0000
(13:50 +0200)
committer
masensio
<masensio@solidgear.es>
Tue, 21 Apr 2015 11:50:13 +0000
(13:50 +0200)
owncloud-android-library
patch
|
blob
|
blame
|
history
src/com/owncloud/android/authentication/AuthenticatorActivity.java
patch
|
blob
|
blame
|
history
src/com/owncloud/android/utils/DisplayUtils.java
patch
|
blob
|
blame
|
history
diff --git
a/owncloud-android-library
b/owncloud-android-library
index
4692c4a
..
9e76138
160000
(submodule)
--- a/
owncloud-android-library
+++ b/
owncloud-android-library
@@
-1
+1
@@
-Subproject commit
4692c4aadeba1d741b2b164af480c929ad4c17e9
+Subproject commit
9e761387a0b406402684571f28c36c2d6d2b6301
diff --git
a/src/com/owncloud/android/authentication/AuthenticatorActivity.java
b/src/com/owncloud/android/authentication/AuthenticatorActivity.java
index
d43df3f
..
ccb0f85
100644
(file)
--- a/
src/com/owncloud/android/authentication/AuthenticatorActivity.java
+++ b/
src/com/owncloud/android/authentication/AuthenticatorActivity.java
@@
-776,9
+776,8
@@
public class AuthenticatorActivity extends AccountAuthenticatorActivity
\r
if (uri.length() != 0) {
\r
// Handle internationalized domain names
\r
\r
if (uri.length() != 0) {
\r
// Handle internationalized domain names
\r
- if (!uri.startsWith(".")) {
\r
- uri = DisplayUtils.convertIdn(uri, true);
\r
- }
\r
+ uri = DisplayUtils.convertIdn(uri, true);
\r
+
\r
mServerStatusText = R.string.auth_testing_connection;
\r
mServerStatusIcon = R.drawable.progress_small;
\r
showServerStatus();
\r
mServerStatusText = R.string.auth_testing_connection;
\r
mServerStatusIcon = R.drawable.progress_small;
\r
showServerStatus();
\r
diff --git
a/src/com/owncloud/android/utils/DisplayUtils.java
b/src/com/owncloud/android/utils/DisplayUtils.java
index
c18a0e4
..
91dfc47
100644
(file)
--- a/
src/com/owncloud/android/utils/DisplayUtils.java
+++ b/
src/com/owncloud/android/utils/DisplayUtils.java
@@
-257,11
+257,18
@@
public class DisplayUtils {
*/
\r
@TargetApi(Build.VERSION_CODES.GINGERBREAD)
\r
public static String convertIdn(String url, boolean toASCII) {
\r
*/
\r
@TargetApi(Build.VERSION_CODES.GINGERBREAD)
\r
public static String convertIdn(String url, boolean toASCII) {
\r
-
\r
+
\r
+ String urlNoDots = url;
\r
+ String dots="";
\r
+ while (urlNoDots.startsWith(".")) {
\r
+ urlNoDots = url.substring(1);
\r
+ dots = dots + ".";
\r
+ }
\r
+
\r
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.GINGERBREAD) {
\r
// Find host name after '//' or '@'
\r
int hostStart = 0;
\r
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.GINGERBREAD) {
\r
// Find host name after '//' or '@'
\r
int hostStart = 0;
\r
- if (url.indexOf("//") != -1) {
\r
+ if (url
NoDots
.indexOf("//") != -1) {
\r
hostStart = url.indexOf("//") + "//".length();
\r
} else if (url.indexOf("@") != -1) {
\r
hostStart = url.indexOf("@") + "@".length();
\r
hostStart = url.indexOf("//") + "//".length();
\r
} else if (url.indexOf("@") != -1) {
\r
hostStart = url.indexOf("@") + "@".length();
\r
@@
-269,14
+276,14
@@
public class DisplayUtils {
\r
int hostEnd = url.substring(hostStart).indexOf("/");
\r
// Handle URL which doesn't have a path (path is implicitly '/')
\r
\r
int hostEnd = url.substring(hostStart).indexOf("/");
\r
// Handle URL which doesn't have a path (path is implicitly '/')
\r
- hostEnd = (hostEnd == -1 ? url.length() : hostStart + hostEnd);
\r
+ hostEnd = (hostEnd == -1 ? url
NoDots
.length() : hostStart + hostEnd);
\r
\r
\r
- String host = url.substring(hostStart, hostEnd);
\r
+ String host = url
NoDots
.substring(hostStart, hostEnd);
\r
host = (toASCII ? IDN.toASCII(host) : IDN.toUnicode(host));
\r
\r
host = (toASCII ? IDN.toASCII(host) : IDN.toUnicode(host));
\r
\r
- return
url.substring(0, hostStart) + host + url
.substring(hostEnd);
\r
+ return
dots + urlNoDots.substring(0, hostStart) + host + urlNoDots
.substring(hostEnd);
\r
} else {
\r
} else {
\r
- return url;
\r
+ return
dots +
url;
\r
}
\r
}
\r
\r
}
\r
}
\r
\r