From: Soren Stoutner Date: Mon, 20 Jun 2016 14:58:46 +0000 (-0700) Subject: Trim white spaces from the beginning and end of the URL before loading. Fixes https... X-Git-Tag: v1.8~9 X-Git-Url: https://gitweb.stoutner.com/?a=commitdiff_plain;h=701035c727e9a9e70f3edc543cf13c930f7ee06a;p=PrivacyBrowserAndroid.git Trim white spaces from the beginning and end of the URL before loading. Fixes https://redmine.stoutner.com/issues/33 --- diff --git a/app/src/main/assets/about_changelog.html b/app/src/main/assets/about_changelog.html index 82810611..8bef6436 100644 --- a/app/src/main/assets/about_changelog.html +++ b/app/src/main/assets/about_changelog.html @@ -27,7 +27,7 @@

1.7 (version code 8)

-

16 June 2016 - minimum API 19, target API 23

+

16 June 2016 - minimum API 19, target API 23

A full list of planned features and bug reports is available on redmine.stoutner.com.

diff --git a/app/src/main/java/com/stoutner/privacybrowser/MainWebViewActivity.java b/app/src/main/java/com/stoutner/privacybrowser/MainWebViewActivity.java index 534ac52d..e4e68c36 100644 --- a/app/src/main/java/com/stoutner/privacybrowser/MainWebViewActivity.java +++ b/app/src/main/java/com/stoutner/privacybrowser/MainWebViewActivity.java @@ -756,8 +756,9 @@ public class MainWebViewActivity extends AppCompatActivity implements Navigation } private void loadUrlFromTextBox() throws UnsupportedEncodingException { - // Get the text from urlTextBox and convert it to a string. - String unformattedUrlString = urlTextBox.getText().toString(); + // Get the text from urlTextBox and convert it to a string. trim() removes white spaces from the beginning and end of the string. + String unformattedUrlString = urlTextBox.getText().toString().trim(); + URL unformattedUrl = null; Uri.Builder formattedUri = new Uri.Builder();