Index: http.cc =================================================================== RCS file: /home/kde/kdelibs/kioslave/http/http.cc,v retrieving revision 1.551.2.15 retrieving revision 1.551.2.21 diff -u -r1.551.2.15 -r1.551.2.21 --- http.cc 7 May 2003 16:43:40 -0000 1.551.2.15 +++ http.cc 4 Jul 2003 11:37:27 -0000 1.551.2.21 @@ -230,19 +229,30 @@ kdDebug(7113) << "(" << m_pid << ") ssl_was_in_use = " << metaData ("ssl_was_in_use") << endl; + m_request.referrer = QString::null; if ( config()->readBoolEntry("SendReferrer", true) && (m_protocol == "https" || m_protocol == "webdavs" || metaData ("ssl_was_in_use") != "TRUE" ) ) - m_request.referrer = metaData("referrer"); - else - m_request.referrer = QString::null; - - if (!m_request.referrer.startsWith("http")) { - if (m_request.referrer.startsWith("webdav")) - m_request.referrer.replace(0, 6, "http"); - else - m_request.referrer = QString::null; + KURL referrerURL = metaData("referrer"); + if (referrerURL.isValid()) + { + // Sanitize + QString protocol = referrerURL.protocol(); + if (protocol.startsWith("webdav")) + { + protocol.replace(0, 6, "http"); + referrerURL.setProtocol(protocol); + } + + if (protocol.startsWith("http")) + { + referrerURL.setRef(QString::null); + referrerURL.setUser(QString::null); + referrerURL.setPass(QString::null); + m_request.referrer = referrerURL.url(); + } + } } if ( config()->readBoolEntry("SendLanguageSettings", true) )