Skip to content
Snippets Groups Projects
Commit 85d34f02 authored by Thomas Mortagne's avatar Thomas Mortagne
Browse files

XWIKI-13742: Put back XWikiDocument#getRenderedContent(String) behavior and...

XWIKI-13742: Put back XWikiDocument#getRenderedContent(String) behavior and move the safeguard at Document level
parent 38019d12
No related branches found
No related tags found
No related merge requests found
......@@ -142,11 +142,10 @@ protected String render() throws EditException
XWikiDocument editorDocument = xcontext.getWiki().getDocument(this.getDocumentReference(), xcontext);
BaseObject editorObject = editorDocument.getXObject(EDITOR_CLASS_REFERENCE);
String editorCode = editorObject.getStringValue("code");
// Make sure the editor code is executed with the rights of the editor document author.
xcontext.put(SECURITY_DOCUMENT, editorDocument);
// Execute the editor code in the context of the current document (because the editor code needs to access
// the data that has been put on the script context).
return xcontext.getDoc().getRenderedContent(editorCode, editorDocument.getSyntax().toIdString(), xcontext);
return xcontext.getDoc().getRenderedContent(editorCode, editorDocument.getSyntax().toIdString(), false,
editorDocument, xcontext);
} catch (Exception e) {
throw new EditException("Failed to render the editor code.", e);
} finally {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment