0 Votes

Changes for page AutoGallery

Last modified by Ryan C on 2025/06/17 16:30

From version 3.14
edited by Ryan C
on 2025/06/17 16:24
Change comment: There is no comment for this version
To version 3.15
edited by Ryan C
on 2025/06/17 16:25
Change comment: There is no comment for this version

Summary

Details

XWiki.WikiMacroClass[0]
Macro code
... ... @@ -10,7 +10,8 @@
10 10  } else {
11 11   html << "<div style='display: flex; flex-wrap: wrap; gap: 10px;'>"
12 12   attachments.each { att ->
13 - def url = "${doc.getExternalURL('download')}/${att.filename.encodeAsURL()}"
13 + def safeFilename = $escapetool.url(att.filename)
14 + def url = "${doc.getExternalURL('download')}/${safeFilename}"
14 14   html << "<div style='margin: 5px; display: inline-block;'>"
15 15   html << "<img src='${url}' style='max-width: 200px;' />"
16 16   html << "</div>"
... ... @@ -19,6 +19,5 @@
19 19  }
20 20  
21 21  wikimacro.result = $services.rendering.parse(html.toString(), "xhtml/1.0").getChildren()
22 -
23 23  {{/groovy}}
24 24  

XWiki AI Chat