From 6241e8d37f0eacde43e8b03e2db8a034c25d7cf4 Mon Sep 17 00:00:00 2001 From: David Rosca Date: Fri, 16 Mar 2018 15:31:37 +0100 Subject: [PATCH] LocationBar: Use WebPage::supportedSchemes to find which schemes to load --- src/lib/navigation/locationbar.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/lib/navigation/locationbar.cpp b/src/lib/navigation/locationbar.cpp index 42271c7e4..8cea9c4a2 100644 --- a/src/lib/navigation/locationbar.cpp +++ b/src/lib/navigation/locationbar.cpp @@ -283,12 +283,8 @@ LocationBar::LoadAction LocationBar::loadAction(const QString &text) const bool forceLoad = guessedUrl.scheme() == QL1S("javascript"); // Only allow spaces in query if (forceLoad || !QzTools::containsSpace(guessedUrl.toString(QUrl::RemoveQuery))) { - // Only allow whitelisted schemes - static const QSet whitelistedSchemes = { - QSL("http"), QSL("https"), QSL("ftp"), QSL("file"), - QSL("data"), QSL("about"), QSL("falkon") - }; - if (forceLoad || whitelistedSchemes.contains(guessedUrl.scheme())) { + // Only allow supported schemes + if (forceLoad || WebPage::supportedSchemes().contains(guessedUrl.scheme())) { action.type = LoadAction::Url; action.loadRequest = guessedUrl; return action;