Skip to content
Snippets Groups Projects
Commit c82f441c 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 052a2a9c
No related branches found
No related tags found
No related merge requests found
......@@ -136,9 +136,9 @@ public EditorDescriptor getDescriptor()
@Override
protected String render() throws EditException
{
XWikiContext xcontext = this.xcontextProvider.get();
XWikiDocument previousSecurityDocument = (XWikiDocument) xcontext.get(SECURITY_DOCUMENT);
try {
XWikiContext xcontext = this.xcontextProvider.get();
XWikiDocument editorDocument = xcontext.getWiki().getDocument(this.getDocumentReference(), xcontext);
BaseObject editorObject = editorDocument.getXObject(EDITOR_CLASS_REFERENCE);
String editorCode = editorObject.getStringValue("code");
......@@ -150,8 +150,6 @@ protected String render() throws EditException
sdoc, xcontext);
} catch (Exception e) {
throw new EditException("Failed to render the editor code.", e);
} finally {
xcontext.put(SECURITY_DOCUMENT, previousSecurityDocument);
}
}
......
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