changeset 1727:8907f3657f80

packages: uses now generic name for attachments as for pages n_attachment
author Reimar Bauer <rb.proj AT googlemail DOT com>
date Tue, 09 Jan 2007 20:38:17 +0100
parents 810a5856c94c
children 97e39d16ae7c
files MoinMoin/packages.py
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/packages.py	Tue Jan 09 20:08:32 2007 +0100
+++ b/MoinMoin/packages.py	Tue Jan 09 20:38:17 2007 +0100
@@ -118,7 +118,7 @@
         #Satisfy pylint
         self.msg = getattr(self, "msg", "")
         self.request = getattr(self, "request", None)
-    def do_addattachment(self, filename, pagename, author=u"Scripting Subsystem", comment=u""):
+    def do_addattachment(self, zipname, filename, pagename, author=u"Scripting Subsystem", comment=u""):
         """
         Installs an attachment
 
@@ -129,12 +129,13 @@
 
         attachments = Page(self.request, pagename).getPagePath("attachments", check_create=1)
         filename = wikiutil.taintfilename(filename)
+        zipname = wikiutil.taintfilename(zipname)
         target = os.path.join(attachments, filename)
         page = PageEditor(self.request, pagename, do_editor_backup=0, uid_override=author)
         rev = page.current_rev()
         path = page.getPagePath(check_create=0)
         if not os.path.exists(target):
-           self._extractToFile(filename, target)
+           self._extractToFile(zipname, target)
            if os.path.exists(target):
               os.chmod(target, config.umask )
               action = 'ATTNEW'