OSDN Git Service

bug fix: browser was not replacing whitepsace in url if scheme is not fully lowercased.
authorMitsuru Oshima <oshima@google.com>
Tue, 19 May 2009 02:11:14 +0000 (19:11 -0700)
committerMitsuru Oshima <oshima@google.com>
Tue, 19 May 2009 02:11:14 +0000 (19:11 -0700)
src/com/android/browser/BrowserActivity.java

index a3a84fb..5caee36 100644 (file)
@@ -4414,14 +4414,14 @@ public class BrowserActivity extends Activity
 
         Matcher matcher = ACCEPTED_URI_SCHEMA.matcher(inUrl);
         if (matcher.matches()) {
-            if (hasSpace) {
-                inUrl = inUrl.replace(" ", "%20");
-            }
             // force scheme to lowercase
             String scheme = matcher.group(1);
             String lcScheme = scheme.toLowerCase();
             if (!lcScheme.equals(scheme)) {
-                return lcScheme + matcher.group(2);
+                inUrl = lcScheme + matcher.group(2);
+            }
+            if (hasSpace) {
+                inUrl = inUrl.replace(" ", "%20");
             }
             return inUrl;
         }