diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2011-03-10 03:57:09 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2011-03-10 03:57:09 (GMT) |
commit | 5c36cc0ba648d5efa7592e86d49b23086cdbb8ff (patch) | |
tree | 56f2542c565e5fb792ac8cc13446f4bd0ee50b3c /src/network/access | |
parent | 051fd1b23e4d7e45b8600571ab6b80afca6f62d9 (diff) | |
parent | bb7b62f3cb7aca178a9e5e65263d0a4a8d40829c (diff) | |
download | Qt-5c36cc0ba648d5efa7592e86d49b23086cdbb8ff.zip Qt-5c36cc0ba648d5efa7592e86d49b23086cdbb8ff.tar.gz Qt-5c36cc0ba648d5efa7592e86d49b23086cdbb8ff.tar.bz2 |
Merge branch 'qt-master-from-4.7' of scm.dev.nokia.troll.no:qt/qt-integration into master-integration
* 'qt-master-from-4.7' of scm.dev.nokia.troll.no:qt/qt-integration:
Fix unstable qdeclarativeflickable test.
Fix possible bearer management Crash with Panic E32USER-CBase, 69
Update TextEdit's visible selection when only the anchor changes.
Fixed memory leak in GL texture cache with QRuntimePixmapData.
QNetworkCookie: fix quoted values
Fix for QTBUG-17746. Quotes is retained in cookie value
Unsuccessful unlocking of QNetworkConfigurationPrivate mutex
Set correct initial value for TextEdit and TextInput canPaste property
Fixed unescaped backslashes in testcase.prf
Fix `make check' for debug-and-release on Windows.
Move `check' target for autotests into testcase.prf
Revert "Backporting TESTARGS feature from 4.7"
Backporting TESTARGS feature from 4.7
Update copyright year to 2011.
embed copyright information in QtAssistantClient4.dll
Diffstat (limited to 'src/network/access')
-rw-r--r-- | src/network/access/qnetworkcookie.cpp | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/src/network/access/qnetworkcookie.cpp b/src/network/access/qnetworkcookie.cpp index 70ea5c2..c2a6925 100644 --- a/src/network/access/qnetworkcookie.cpp +++ b/src/network/access/qnetworkcookie.cpp @@ -359,7 +359,7 @@ void QNetworkCookie::setValue(const QByteArray &value) } // ### move this to qnetworkcookie_p.h and share with qnetworkaccesshttpbackend -static QPair<QByteArray, QByteArray> nextField(const QByteArray &text, int &position) +static QPair<QByteArray, QByteArray> nextField(const QByteArray &text, int &position, bool isNameValue) { // format is one of: // (1) token @@ -394,13 +394,22 @@ static QPair<QByteArray, QByteArray> nextField(const QByteArray &text, int &posi // quoted-string = ( <"> *(qdtext | quoted-pair ) <"> ) // qdtext = <any TEXT except <">> // quoted-pair = "\" CHAR + + // If its NAME=VALUE, retain the value as is + // refer to ttp://bugreports.qt.nokia.com/browse/QTBUG-17746 + if (isNameValue) + second += '"'; ++i; while (i < length) { register char c = text.at(i); if (c == '"') { // end of quoted text + if (isNameValue) + second += '"'; break; } else if (c == '\\') { + if (isNameValue) + second += '\\'; ++i; if (i >= length) // broken line @@ -476,10 +485,12 @@ QByteArray QNetworkCookie::toRawForm(RawForm form) const result = d->name; result += '='; - if (d->value.contains(';') || + if ((d->value.contains(';') || d->value.contains(',') || d->value.contains(' ') || - d->value.contains('"')) { + d->value.contains('"')) && + (!d->value.startsWith('"') && + !d->value.endsWith('"'))) { result += '"'; QByteArray value = d->value; @@ -947,7 +958,7 @@ QList<QNetworkCookie> QNetworkCookiePrivate::parseSetCookieHeaderLine(const QByt QNetworkCookie cookie; // The first part is always the "NAME=VALUE" part - QPair<QByteArray,QByteArray> field = nextField(cookieString, position); + QPair<QByteArray,QByteArray> field = nextField(cookieString, position, true); if (field.first.isEmpty() || field.second.isNull()) // parsing error break; @@ -965,7 +976,7 @@ QList<QNetworkCookie> QNetworkCookiePrivate::parseSetCookieHeaderLine(const QByt case ';': // new field in the cookie - field = nextField(cookieString, position); + field = nextField(cookieString, position, false); field.first = field.first.toLower(); // everything but the NAME=VALUE is case-insensitive if (field.first == "expires") { |