Show an error message for invalid server url
authormasensio <masensio@solidgear.es>
Fri, 17 Apr 2015 12:10:41 +0000 (14:10 +0200)
committermasensio <masensio@solidgear.es>
Fri, 17 Apr 2015 12:10:41 +0000 (14:10 +0200)
owncloud-android-library
src/com/owncloud/android/authentication/AuthenticatorActivity.java
src/com/owncloud/android/utils/DisplayUtils.java

index 9e76138..4692c4a 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 9e761387a0b406402684571f28c36c2d6d2b6301
+Subproject commit 4692c4aadeba1d741b2b164af480c929ad4c17e9
index 1e4e8b4..d43df3f 100644 (file)
@@ -380,7 +380,7 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
             findViewById(R.id.hostUrlFrame).setVisibility(View.GONE);\r
             mRefreshButton = findViewById(R.id.centeredRefreshButton);\r
         }\r
-        showRefreshButton(mServerIsChecked && !mServerIsValid && \r
+        showRefreshButton(mServerIsChecked && !mServerIsValid &&\r
                 mWaitingForOpId > Integer.MAX_VALUE);\r
         mServerStatusView = (TextView) findViewById(R.id.server_status_text);\r
         showServerStatus();\r
@@ -773,10 +773,12 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
         mOkButton.setEnabled(false);\r
         mServerInfo = new GetServerInfoOperation.ServerInfo();\r
         showRefreshButton(false);\r
-        \r
+\r
         if (uri.length() != 0) {\r
             // Handle internationalized domain names\r
-            uri = DisplayUtils.convertIdn(uri, true);\r
+            if (!uri.startsWith(".")) {\r
+                uri = DisplayUtils.convertIdn(uri, true);\r
+            }\r
             mServerStatusText = R.string.auth_testing_connection;\r
             mServerStatusIcon = R.drawable.progress_small;\r
             showServerStatus();\r
index 905f60b..c18a0e4 100644 (file)
@@ -266,14 +266,14 @@ public class DisplayUtils {
             } else if (url.indexOf("@") != -1) {\r
                 hostStart = url.indexOf("@") + "@".length();\r
             }\r
-            \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
-            \r
+\r
             String host = url.substring(hostStart, hostEnd);\r
             host = (toASCII ? IDN.toASCII(host) : IDN.toUnicode(host));\r
-            \r
+\r
             return url.substring(0, hostStart) + host + url.substring(hostEnd);\r
         } else {\r
             return url;\r