summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin C Meyer <benjamin.meyer@torchmobile.com>2009-03-30 16:45:50 (GMT)
committerThiago Macieira <thiago.macieira@nokia.com>2009-03-30 16:47:09 (GMT)
commitca119ee4b440c1ebbd456417a60167e2998de4d9 (patch)
treee654c91c8c8e748fcc2af651d0eeeedff1b07027
parente475c68f22732553caad350608f2539db7694979 (diff)
downloadQt-ca119ee4b440c1ebbd456417a60167e2998de4d9.zip
Qt-ca119ee4b440c1ebbd456417a60167e2998de4d9.tar.gz
Qt-ca119ee4b440c1ebbd456417a60167e2998de4d9.tar.bz2
Fix the parsing of October dates.
The code was looking for a 't' to detect GMT-nnnn. It should really be checking for 'gmt'. Signed-off-by: Thiago Macieira <thiago.macieira@nokia.com>
-rw-r--r--src/network/access/qnetworkcookie.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/network/access/qnetworkcookie.cpp b/src/network/access/qnetworkcookie.cpp
index fed0afc..b82d8f9 100644
--- a/src/network/access/qnetworkcookie.cpp
+++ b/src/network/access/qnetworkcookie.cpp
@@ -636,8 +636,6 @@ static QDateTime parseDateString(const QByteArray &dateString)
qDebug() << "Month:" << month;
#endif
at += 3;
- if (at < dateString.length() && dateString[at] == '-')
- ++at;
continue;
}
// Zone
@@ -659,7 +657,10 @@ static QDateTime parseDateString(const QByteArray &dateString)
&& (at == 0
|| isWhitespace(dateString[at - 1])
|| dateString[at - 1] == ','
- || (dateString[at - 1] == 't'))) {
+ || (at >= 3
+ && (dateString[at - 3] == 'g')
+ && (dateString[at - 2] == 'm')
+ && (dateString[at - 1] == 't')))) {
int end = 1;
while (end < 5 && dateString.length() > at+end