Commit 6d591e65 authored by Tony Murray's avatar Tony Murray

Utf8 encode usernames before constructing a KUrl with them.

BUG: 256237

svn path=/trunk/KDE/kdenetwork/krdc/; revision=1207579
parent e27ecf16
......@@ -291,8 +291,20 @@ void MainWindow::restoreOpenSessions()
KUrl MainWindow::getInputUrl()
{
KUrl inputUrl;
inputUrl.setAuthority(m_addressInput->text());
inputUrl.setProtocol(m_protocolInput->currentText());
// Work around incorrect KUrl parsing of @
QString enteredAddress = m_addressInput->text();
int atLocation = enteredAddress.lastIndexOf(QLatin1Char('@'));
// set the non-username part of the url
inputUrl.setAuthority(enteredAddress.mid(atLocation + 1));
// if the url contains @, set the username part. it needs to be utf8 encoded
if(atLocation > 0) {
inputUrl.setUserName(enteredAddress.left(atLocation).toUtf8());
}
return inputUrl;
}
......
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