1.1 --- a/MoinMessageSupport.py Fri Apr 10 17:21:27 2015 +0200
1.2 +++ b/MoinMessageSupport.py Sat Apr 11 17:07:36 2015 +0200
1.3 @@ -2,7 +2,7 @@
1.4 """
1.5 MoinMoin - MoinMessageSupport library
1.6
1.7 - @copyright: 2012, 2013, 2014 by Paul Boddie <paul@boddie.org.uk>
1.8 + @copyright: 2012, 2013, 2014, 2015 by Paul Boddie <paul@boddie.org.uk>
1.9 @license: GNU GPL (v2 or later), see COPYING.txt for details.
1.10 """
1.11
1.12 @@ -20,6 +20,7 @@
1.13 is_signed, is_encrypted, getContentAndSignature
1.14 from MoinSupport import getHeader, getMetadata, getWikiDict, writeHeaders, \
1.15 parseDictEntry, getStaticContentDirectory
1.16 +from DateSupport import getDateTimeFromRFC2822
1.17 from ItemSupport import ItemStore
1.18 from TokenSupport import getIdentifiers
1.19
1.20 @@ -253,6 +254,7 @@
1.21 # Test any date against the page or message store (if not empty).
1.22
1.23 if message.date:
1.24 + date = getDateTimeFromRFC2822(message.date)
1.25 store_date = time.gmtime(self.store.mtime())
1.26 page_date = time.gmtime(version2timestamp(self.page.mtime_usecs()))
1.27
1.28 @@ -263,9 +265,9 @@
1.29
1.30 # Reject messages older than the page date.
1.31
1.32 - if message.date.to_utc().as_tuple() < last_date:
1.33 + if date.to_utc().as_tuple() < last_date:
1.34 writeHeaders(request, "text/plain", getMetadata(self.page), "403 Forbidden")
1.35 - request.write("The message is too old: %s versus %s." % (message.date, time.strftime("%Y-%m-%d %H:%M:%S", last_date)))
1.36 + request.write("The message is too old: %s versus %s." % (date, time.strftime("%Y-%m-%d %H:%M:%S", last_date)))
1.37 return
1.38
1.39 # Reject messages without dates if so configured.