changeset 425:cb407ef26818

action.svgEditor: updated to be compatible with t/anywikidraw
author Reimar Bauer <rb.proj AT googlemail DOT com>
date Tue, 22 Sep 2009 11:02:09 +0200
parents 0b33069ed160
children 2800dd19d154
files data/plugin/action/SvgEditor.py
diffstat 1 files changed, 4 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/data/plugin/action/SvgEditor.py	Sat Sep 19 22:32:49 2009 +0200
+++ b/data/plugin/action/SvgEditor.py	Tue Sep 22 11:02:09 2009 +0200
@@ -26,7 +26,8 @@
     # we force the title here, needed later for html>wiki converter
     kw['title'] = "drawing:%s" % wikiutil.quoteWikinameURL(url)
     pagename, drawing = AttachFile.absoluteName(url, self.page.page_name)
-    drawing_url = AttachFile.getAttachUrl(pagename, drawing+'.svg', self.request, drawing=drawing, upload=True)
+    drawing = wikiutil.taintfilename(drawing)
+    drawing_url = AttachFile.getAttachUrl(pagename, drawing, self.request, do='modify')
     if not AttachFile.exists(self.request, pagename, drawing+'.svg'):
         title = _('Create new drawing "%(filename)s (opens in new window)"') % {'filename': drawing}
         img = self.icon('attachimg')  # TODO: we need a new "drawimg" in similar grey style and size
@@ -42,10 +43,8 @@
     # XXX text arg is unused!
     _ = self.request.getText
     pagename, drawing = AttachFile.absoluteName(url, self.page.page_name)
-    if not drawing.endswith('.svg'):
-        drawing = "%s%s" % (drawing, '.svg')
-
-    drawing_url = AttachFile.getAttachUrl(pagename, drawing, self.request, drawing=drawing, upload=True)
+    drawing = wikiutil.taintfilename(drawing)
+    drawing_url = AttachFile.getAttachUrl(pagename, drawing, self.request, do='modify')
     if not AttachFile.exists(self.request, pagename, drawing):
         title = _('Create new drawing "%(filename)s (opens in new window)"') % {'filename': drawing}
         img = self.icon('attachimg')  # TODO: we need a new "drawimg" in similar grey style and size