kdWarning(6070) << "Javascript: access denied for current frame '" << actDomain.string() << "' to frame '" << thisDomain.string() << "'" << endl;
return false;
@@ -1164,11 +1164,11 @@ Value WindowFunc::tryCall(ExecState *exe
khtmlpart->begin();
khtmlpart->write("<HTML><BODY>");
khtmlpart->end();
if ( part->docImpl() ) {
kdDebug(6070) << "Setting domain to " << part->docImpl()->domain().string() << endl;
- khtmlpart->docImpl()->setDomain( part->docImpl()->domain(), true );
+ khtmlpart->docImpl()->setDomain( part->docImpl()->domain());
khtmlpart->docImpl()->setBaseURL( part->docImpl()->baseURL() );
}
}
uargs.serviceType = QString::null;
if (uargs.frameName == "_blank")
Index: html/html_documentimpl.cpp
===================================================================
RCS file: /home/kde/kdelibs/khtml/html/html_documentimpl.cpp,v
retrieving revision 1.139.2.1
diff -u -5 -d -p -r1.139.2.1 html_documentimpl.cpp
--- html/html_documentimpl.cpp 2002/06/17 18:33:37 1.139.2.1
+++ html/html_documentimpl.cpp 2002/09/06 21:41:23
@@ -93,31 +93,31 @@ DOMString HTMLDocumentImpl::domain() con
if ( m_domain.isEmpty() ) // not set yet (we set it on demand to save time and space)
m_domain = KURL(URL()).host(); // Initially set to the host
return m_domain;
}
-void HTMLDocumentImpl::setDomain(const DOMString &newDomain, bool force /*=false*/)
+void HTMLDocumentImpl::setDomain(const DOMString &newDomain)
{
- if ( force ) {
- m_domain = newDomain;
- return;
- }
if ( m_domain.isEmpty() ) // not set yet (we set it on demand to save time and space)
- m_domain = KURL(URL()).host(); // Initially set to the host
+ m_domain = KURL(URL()).host().lower(); // Initially set to the host
+
+ if ( m_domain.isEmpty() /*&& view() && view()->part()->openedByJS()*/ )
+ m_domain = newDomain.lower();
// Both NS and IE specify that changing the domain is only allowed when
// the new domain is a suffix of the old domain.
int oldLength = m_domain.length();
int newLength = newDomain.length();
if ( newLength < oldLength ) // e.g. newDomain=kde.org (7) and m_domain=www.kde.org (11)
{
DOMString test = m_domain.copy();
+ DOMString reference = newDomain.lower();
if ( test[oldLength - newLength - 1] == '.' ) // Check that it's a subdomain, not e.g. "de.org"
{
test.remove( 0, oldLength - newLength ); // now test is "kde.org" from m_domain
- if ( test == newDomain ) // and we check that it's the same thing as newDomain
- m_domain = newDomain;
+ if ( test == reference ) // and we check that it's the same thing as newDomain
+ m_domain = reference;
}
}
}
DOMString referrer() const;
DOMString domain() const;
- void setDomain( const DOMString &newDomain, bool force = false ); // not part of the DOM
+ void setDomain( const DOMString &newDomain ); // not part of the DOM
DOMString lastModified() const;
DOMString cookie() const;
void setCookie( const DOMString &);