From 701035c727e9a9e70f3edc543cf13c930f7ee06a Mon Sep 17 00:00:00 2001 From: Soren Stoutner Date: Mon, 20 Jun 2016 07:58:46 -0700 Subject: [PATCH] Trim white spaces from the beginning and end of the URL before loading. Fixes https://redmine.stoutner.com/issues/33 --- app/src/main/assets/about_changelog.html | 2 +- app/src/main/assets/guide_clear_and_exit.html | 17 +++++++++-------- app/src/main/assets/guide_planned_features.html | 1 + .../privacybrowser/MainWebViewActivity.java | 5 +++-- 4 files changed, 14 insertions(+), 11 deletions(-) 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(); -- 2.45.2