changeset 5493:07833d54f43d

wiki parser: fix transclusion of attachments on other pages
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Fri, 05 Feb 2010 09:36:55 +0100
parents e900c097a46b
children da4384535256
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	Thu Feb 04 10:44:39 2010 +0100
+++ b/MoinMoin/parser/text_moin_wiki.py	Fri Feb 05 09:36:55 2010 +0100
@@ -740,9 +740,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)
+                        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)
                             tag_attrs, query_args = self._get_params(params,
                                                                      tag_attrs={'title': desc, },
                                                                      acceptable_attrs=acceptable_attrs_object)