summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qurl_p.h
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2011-12-28 15:59:47 -0200
committerQt by Nokia <qt-info@nokia.com>2012-03-30 01:19:59 +0200
commit329ee8cedc78de5304a84e0b205b08f39e439411 (patch)
tree146167cd8f1f6781d0d5800274c085b9383b4c03 /src/corelib/io/qurl_p.h
parentcff38329aa8635ac8a0696b0aa78782fe5605d16 (diff)
Reimplement the StrictMode URL parsing
The strict mode check is now implemented after the tolerant parser has finished, and only if the tolerant parser has not found any errors. We catch the use of disallowed characters (control characters plus a few not permitted anywhere) and broken percent encodings. We do not catch the use of Unicode characters, as they are permitted in IRIs. In the tests, remove the old errorString test since it makes little sense. Change-Id: I8261a2ccad031ad68fc6377a206e59c9db89fb38 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Diffstat (limited to 'src/corelib/io/qurl_p.h')
-rw-r--r--src/corelib/io/qurl_p.h22
1 files changed, 16 insertions, 6 deletions
diff --git a/src/corelib/io/qurl_p.h b/src/corelib/io/qurl_p.h
index d9207bd809..fb54d74260 100644
--- a/src/corelib/io/qurl_p.h
+++ b/src/corelib/io/qurl_p.h
@@ -75,27 +75,37 @@ public:
};
enum ErrorCode {
- InvalidSchemeError = 0x000,
+ // the high byte of the error code matches the Section
+ InvalidSchemeError = Scheme << 8,
SchemeEmptyError,
- InvalidRegNameError = 0x800,
+ InvalidUserNameError = UserName << 8,
+
+ InvalidPasswordError = Password << 8,
+
+ InvalidRegNameError = Host << 8,
InvalidIPv4AddressError,
InvalidIPv6AddressError,
InvalidIPvFutureError,
HostMissingEndBracket,
- InvalidPortError = 0x1000,
+ InvalidPortError = Port << 8,
PortEmptyError,
- PathContainsColonBeforeSlash = 0x2000,
+ InvalidPathError = Path << 8,
+ PathContainsColonBeforeSlash,
+
+ InvalidQueryError = Query << 8,
+
+ InvalidFragmentError = Fragment << 8,
- NoError = 0xffff
+ NoError = 0
};
QUrlPrivate();
QUrlPrivate(const QUrlPrivate &copy);
- void parse(const QString &url);
+ void parse(const QString &url, QUrl::ParsingMode parsingMode);
void clear();
// no QString scheme() const;