Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Evergreen:11.1
kdelibs4
patch-r888820.diff
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File patch-r888820.diff of Package kdelibs4
Subject: don't include passwords in url drags From: wstephenson@suse.de Bug: Patch-upstream: 888820 --- kdecore/tests/kurlmimetest.cpp (revision 888819) +++ kdecore/tests/kurlmimetest.cpp (revision 888820) @@ -34,6 +34,7 @@ void KUrlMimeTest::testURLList() KUrl::List urls; urls.append( KUrl( "http://www.kde.org" ) ); + urls.append( KUrl( "http://wstephenson:secret@example.com/path" ) ); urls.append( KUrl( "file:///home/dfaure/konqtests/Mat%C3%A9riel" ) ); QMap<QString, QString> metaData; metaData["key"] = "value"; @@ -47,7 +48,9 @@ void KUrlMimeTest::testURLList() QMap<QString, QString> decodedMetaData; KUrl::List decodedURLs = KUrl::List::fromMimeData( mimeData, &decodedMetaData ); QVERIFY( !decodedURLs.isEmpty() ); - QCOMPARE( urls.toStringList().join(" "), decodedURLs.toStringList().join(" ") ); + KUrl::List expectedUrls = urls; + expectedUrls[1] = KUrl("http://wstephenson@example.com/path"); // password removed + QCOMPARE( expectedUrls.toStringList().join(" "), decodedURLs.toStringList().join(" ") ); QList<QUrl> qurls = mimeData->urls(); QCOMPARE(qurls.count(), urls.count()); --- kdecore/io/kurl.cpp (revision 888819) +++ kdecore/io/kurl.cpp (revision 888820) @@ -1107,7 +1107,12 @@ QString KUrl::toMimeDataString() const / #endif } - return url(/*0 , 106*/); // 106 is mib enum for utf8 codec + if (hasPass()) { + KUrl safeUrl(*this); + safeUrl.setPassword(QString()); + return safeUrl.url(); + } + return url(); } KUrl KUrl::fromMimeDataByteArray( const QByteArray& str ) Index: kdecore/tests/kurlmimetest.cpp =================================================================== Index: kdecore/io/kurl.cpp ===================================================================
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor