Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Unmaintained
KDE Libraries
Commits
92c2db2b
Commit
92c2db2b
authored
Jul 04, 2003
by
Waldo Bastian
Browse files
Sanitize referrer
svn path=/branches/KDE_2_2_BRANCH/kdelibs/; revision=235422
parent
1352f313
Changes
1
Hide whitespace changes
Inline
Side-by-side
kio/http/http.cc
View file @
92c2db2b
...
...
@@ -864,12 +864,24 @@ bool HTTPProtocol::http_open()
bool
sendReferrer
=
config
()
->
readBoolEntry
(
"SendReferrer"
,
true
);
if
(
sendReferrer
)
{
QString
referrer
=
config
()
->
readEntry
(
"referrer"
);
if
(
!
referrer
.
isEmpty
())
KURL
referrer
URL
=
config
()
->
readEntry
(
"referrer"
);
if
(
referrer
URL
.
isValid
())
{
header
+=
"Referer: "
;
header
+=
referrer
;
header
+=
"
\r\n
"
;
//Don't try to correct spelling!
// Sanitize
QString
protocol
=
referrerURL
.
protocol
();
if
((
protocol
==
"http"
)
||
((
protocol
==
"https"
)
&&
(
m_protocol
==
"https"
))
)
{
referrerURL
.
setRef
(
QString
::
null
);
referrerURL
.
setUser
(
QString
::
null
);
referrerURL
.
setPass
(
QString
::
null
);
header
+=
"Referer: "
;
header
+=
referrerURL
.
url
();
header
+=
"
\r\n
"
;
//Don't try to correct spelling!
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment