changeset 5506:a4b4cd17410c

wiki parser: fix transclusion of attachments on other pages (backport from 1.9)
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sat, 06 Feb 2010 00:24:34 +0100
parents fb28b058a4f6
children 86273969a1d8
files MoinMoin/parser/text_moin_wiki.py
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/parser/text_moin_wiki.py	Tue Jan 19 23:59:37 2010 +0100
+++ b/MoinMoin/parser/text_moin_wiki.py	Sat Feb 06 00:24:34 2010 +0100
@@ -739,9 +739,10 @@
                         return self.formatter.attachment_image(url, **tag_attrs)
                     else:
                         from MoinMoin.action import AttachFile
-                        pagename = self.formatter.page.page_name
-                        if AttachFile.exists(self.request, pagename, url):
-                            href = AttachFile.getAttachUrl(pagename, url, self.request, escaped=0)
+                        current_pagename = self.formatter.page.page_name
+                        pagename, filename = AttachFile.absoluteName(url, current_pagename)
+                        if AttachFile.exists(self.request, pagename, filename):
+                            href = AttachFile.getAttachUrl(pagename, filename, self.request, escaped=0)
                             tag_attrs, query_args = self._get_params(params,
                                                                      tag_attrs={'title': desc, },
                                                                      acceptable_attrs=acceptable_attrs_object)