diff MoinMoin/action/AttachFile.py @ 1797:25c93ded258b

AttachFile: getText of add_attachment fixed, Load:only PageEditor restricts uploading of pages
author Reimar Bauer <rb.proj AT googlemail DOT com>
date Fri, 23 Feb 2007 21:01:33 +0100
parents 57f12932915f
children cabab80d9597
line wrap: on
line diff
--- a/MoinMoin/action/AttachFile.py	Fri Feb 23 20:31:08 2007 +0100
+++ b/MoinMoin/action/AttachFile.py	Fri Feb 23 21:01:33 2007 +0100
@@ -165,6 +165,9 @@
 
 def add_attachment(request, pagename, target, filecontent, overwrite=0):
     # replace illegal chars
+
+    _ = request.getText
+
     target = wikiutil.taintfilename(target)
 
     # set mimetype from extension, or from given mimetype
@@ -828,7 +831,7 @@
 
         request.emit_http_headers([
             'Content-Type: %s' % content_type,
-            'Last-Modified: %s' % timestamp,
+            'Last-Modified: %s' % timestamp, # TODO maybe add a short Expires: header here?
             'Content-Length: %d' % os.path.getsize(fpath),
             'Content-Disposition: %s; filename="%s"' % (content_dispo, filename_enc),
         ])