summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Dywan <christian@twotoasts.de>2019-02-28 19:40:15 +0100
committerGitHub <noreply@github.com>2019-02-28 19:40:15 +0100
commit72e39eef9f65ad3f47a51cd2fa6e6e4acccbcc89 (patch)
tree7f93355e57cff0ae5a20a3de166192dd1b9ecb9d
parent525f76c68fdde8a2d974c6975d9cc5ebe0cd594b (diff)
downloadmidori-git-72e39eef9f65ad3f47a51cd2fa6e6e4acccbcc89.tar.gz
Explicitly check for leading or trailing space in urlbar (#280)
Otherwise eg. javascript: URLs with spaces don't work as expected
-rw-r--r--core/urlbar.vala3
1 files changed, 2 insertions, 1 deletions
diff --git a/core/urlbar.vala b/core/urlbar.vala
index 2d217861..2f37b3e5 100644
--- a/core/urlbar.vala
+++ b/core/urlbar.vala
@@ -177,7 +177,8 @@ namespace Midori {
}
string? magic_uri (string text) {
- if (" " in text) {
+ // Leading or trailing space means search
+ if (text.has_prefix (" ") || text.has_suffix (" ")) {
return null;
} else if (Path.is_absolute (text)) {
try {