summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2015-02-10 08:26:14 -0800
committerThiago Macieira <thiago.macieira@intel.com>2015-02-16 05:31:17 +0000
commitafb52763aa759b3b60be2816212af04d0063595c (patch)
treea7b918c2cc9bffc6e64f557811092847b228dc4a
parentab3113b679922e5232d56a9532c4330b8986e493 (diff)
Doc: clarify what QUrl::topLevelDomain actually does
Task-number: QTBUG-44390 Change-Id: I1a800c709d3543699131ffff13c19789a12dac0b Reviewed-by: Martin Smith <martin.smith@digia.com> Reviewed-by: Richard J. Moore <rich@kde.org>
-rw-r--r--src/corelib/io/qurl.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/corelib/io/qurl.cpp b/src/corelib/io/qurl.cpp
index eb97eaf6d6..f459928110 100644
--- a/src/corelib/io/qurl.cpp
+++ b/src/corelib/io/qurl.cpp
@@ -3083,6 +3083,21 @@ bool QUrl::hasFragment() const
URL does not contain a valid TLD, in which case the function returns
an empty string.
+ Note that this function considers a TLD to be any domain that allows users
+ to register subdomains under, including many home, dynamic DNS websites and
+ blogging providers. This is useful for determining whether two websites
+ belong to the same infrastructure and communication should be allowed, such
+ as browser cookies: two domains should be considered part of the same
+ website if they share at least one label in addition to the value
+ returned by this function.
+
+ \list
+ \li \c{foo.co.uk} and \c{foo.com} do not share a top-level domain
+ \li \c{foo.co.uk} and \c{bar.co.uk} share the \c{.co.uk} domain, but the next label is different
+ \li \c{www.foo.co.uk} and \c{ftp.foo.co.uk} share the same top-level domain and one more label,
+ so they are considered part of the same site
+ \endlist
+
If \a options includes EncodeUnicode, the returned string will be in
ASCII Compatible Encoding.
*/