mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-20 10:46:35 +01:00
Merge branch 'Falkon/3.0'
This commit is contained in:
commit
d329db7a08
@ -214,4 +214,17 @@ void LocationBarTest::loadAction_issue2578()
|
|||||||
QCOMPARE(action.type, LocationBar::LoadAction::Invalid);
|
QCOMPARE(action.type, LocationBar::LoadAction::Invalid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void LocationBarTest::loadAction_kdebug392445()
|
||||||
|
{
|
||||||
|
// %20 in url will make it incorrectly treat as web search
|
||||||
|
|
||||||
|
qzSettings->searchFromAddressBar = true;
|
||||||
|
|
||||||
|
LocationBar::LoadAction action;
|
||||||
|
|
||||||
|
action = LocationBar::loadAction("http://www.example.com/my%20beautiful%20page");
|
||||||
|
QCOMPARE(action.type, LocationBar::LoadAction::Url);
|
||||||
|
QCOMPARE(action.loadRequest.url(), QUrl("http://www.example.com/my%20beautiful%20page"));
|
||||||
|
}
|
||||||
|
|
||||||
FALKONTEST_MAIN(LocationBarTest)
|
FALKONTEST_MAIN(LocationBarTest)
|
||||||
|
@ -34,4 +34,5 @@ private Q_SLOTS:
|
|||||||
void loadAction_kdebug389491();
|
void loadAction_kdebug389491();
|
||||||
void loadActionSpecialSchemesTest();
|
void loadActionSpecialSchemesTest();
|
||||||
void loadAction_issue2578();
|
void loadAction_issue2578();
|
||||||
|
void loadAction_kdebug392445();
|
||||||
};
|
};
|
||||||
|
@ -277,12 +277,12 @@ LocationBar::LoadAction LocationBar::loadAction(const QString &text)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Otherwise load as url
|
// Otherwise load as url
|
||||||
const QUrl &guessedUrl = QUrl::fromUserInput(t);
|
const QUrl guessedUrl = QUrl::fromUserInput(t);
|
||||||
if (guessedUrl.isValid()) {
|
if (guessedUrl.isValid()) {
|
||||||
// Always allow javascript: to be loaded
|
// Always allow javascript: to be loaded
|
||||||
const bool forceLoad = guessedUrl.scheme() == QL1S("javascript");
|
const bool forceLoad = guessedUrl.scheme() == QL1S("javascript");
|
||||||
// Only allow spaces in query
|
// Only allow spaces in query
|
||||||
if (forceLoad || !QzTools::containsSpace(guessedUrl.toString(QUrl::RemoveQuery))) {
|
if (forceLoad || !QzTools::containsSpace(t) || !QzTools::containsSpace(guessedUrl.toString(QUrl::RemoveQuery))) {
|
||||||
// Only allow supported schemes
|
// Only allow supported schemes
|
||||||
if (forceLoad || WebPage::supportedSchemes().contains(guessedUrl.scheme())) {
|
if (forceLoad || WebPage::supportedSchemes().contains(guessedUrl.scheme())) {
|
||||||
action.type = LoadAction::Url;
|
action.type = LoadAction::Url;
|
||||||
|
Loading…
Reference in New Issue
Block a user