Commit a29054a7 authored by Tony Murray's avatar Tony Murray

URL encode the username before passing to KUrl. This will allow @ in usernames.

parent 3197814b
......@@ -279,7 +279,15 @@ void MainWindow::restoreOpenSessions()
KUrl MainWindow::getInputUrl()
{
return KUrl(m_protocolInput->currentText() + "://" + m_addressInput->text());
QString userInput = m_addressInput->text();
// percent encode usernames so KUrl can parse it
int lastAtIndex = userInput.indexOf(QRegExp("@[^@]+$"));
if (lastAtIndex >0) {
userInput = KUrl::toPercentEncoding(userInput.left(lastAtIndex)) + userInput.mid(lastAtIndex);
}
return KUrl(m_protocolInput->currentText() + "://" + userInput);
}
void MainWindow::newConnection(const KUrl &newUrl, bool switchFullscreenWhenConnected, const QString &tabName)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment