diff MoinMoin/action/AttachFile.py @ 5101:d8ccac2f24c5

getAttachUrl: removed escaped=... param (see below) If one needs to escape a resulting url, one has to call wikiutil.escape(url) or wikiutil.escape(url, 1) on the result.
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sun, 13 Sep 2009 02:44:37 +0200
parents ff588e9e24d6
children 9ae242080889
line wrap: on
line diff
--- a/MoinMoin/action/AttachFile.py	Sun Sep 13 00:46:27 2009 +0200
+++ b/MoinMoin/action/AttachFile.py	Sun Sep 13 02:44:37 2009 +0200
@@ -82,7 +82,7 @@
     else:
         return u"/".join(pieces[:-1]), pieces[-1]
 
-def getAttachUrl(pagename, filename, request, addts=0, escaped=0, do='get', drawing=''):
+def getAttachUrl(pagename, filename, request, addts=0, do='get', drawing=''):
     """ Get URL that points to attachment `filename` of page `pagename`.
         For upload url (files, not drawings), call with do='upload_form'.
     """
@@ -389,9 +389,10 @@
 def send_link_rel(request, pagename):
     files = _get_files(request, pagename)
     for fname in files:
-        url = getAttachUrl(pagename, fname, request, do='view', escaped=1)
+        url = getAttachUrl(pagename, fname, request, do='view')
         request.write(u'<link rel="Appendix" title="%s" href="%s">\n' % (
-                      wikiutil.escape(fname, 1), url))
+                      wikiutil.escape(fname, 1),
+                      wikiutil.escape(url, 1)))
 
 def send_uploadform(pagename, request):
     """ Send the HTML code for the list of already stored attachments and
@@ -947,8 +948,9 @@
 
     # destinguishs if browser need a plugin in place
     if mt.major == 'image' and mt.minor in config.browser_supported_images:
+        url = getAttachUrl(pagename, filename, request)
         request.write('<img src="%s" alt="%s">' % (
-            getAttachUrl(pagename, filename, request, escaped=1),
+            wikiutil.escape(url, 1),
             wikiutil.escape(filename, 1)))
         return
     elif mt.major == 'text':