Source:
<code>public static void feedDataForWYSIWYGEditor(UIWikiPageEditForm pageEditForm, String markup) throws Exception { UIWikiPortlet wikiPortlet = pageEditForm.getAncestorOfType(UIWikiPortlet.class); UIWikiRichTextArea richTextArea = pageEditForm.getChild(UIWikiRichTextArea.class); RenderingService renderingService = (RenderingService) PortalContainer.getComponent(RenderingService.class); HttpSession session = Util.getPortalRequestContext().getRequest().getSession(false); UIFormTextAreaInput markupInput = pageEditForm.getUIFormTextAreaInput(UIWikiPageEditForm.FIELD_CONTENT); String markupSyntax = getDefaultSyntax(); WikiContext wikiContext= Utils.setUpWikiContext(wikiPortlet); if (markup == null) { markup = (markupInput.getValue() == null) ? "" : markupInput.getValue(); } String xhtmlContent = renderingService.render(markup, markupSyntax, Syntax.ANNOTATED_XHTML_1_0.toIdString(), false); richTextArea.getUIFormTextAreaInput().setValue(xhtmlContent); <START> session.setAttribute(UIWikiRichTextArea.SESSION_KEY, xhtmlContent); <END> session.setAttribute(UIWikiRichTextArea.WIKI_CONTEXT, wikiContext); ExoContainer container = ExoContainerContext.getCurrentContainer(); SessionManager sessionManager = (SessionManager) container.getComponentInstanceOfType(SessionManager.class); sessionManager.addSessionContext(session.getId(), Utils.createWikiContext(wikiPortlet)); sessionManager.addSessionContext(ConversationState.getCurrent().getIdentity().getUserId(), Utils.createWikiContext(wikiPortlet)); if (sessionManager.getSessionContainer(session.getId()) != null) { sessionManager.addSessionContainer(ConversationState.getCurrent().getIdentity().getUserId(), sessionManager.getSessionContainer(session.getId())); } }</code><technical_language>delete sanitizer, improve fix problem original XSS issue</technical_language>

Target:
public static void feedDataForWYSIWYGEditor(UIWikiPageEditForm pageEditForm, String markup) throws Exception { UIWikiPortlet wikiPortlet = pageEditForm.getAncestorOfType(UIWikiPortlet.class); UIWikiRichTextArea richTextArea = pageEditForm.getChild(UIWikiRichTextArea.class); RenderingService renderingService = (RenderingService) PortalContainer.getComponent(RenderingService.class); HttpSession session = Util.getPortalRequestContext().getRequest().getSession(false); UIFormTextAreaInput markupInput = pageEditForm.getUIFormTextAreaInput(UIWikiPageEditForm.FIELD_CONTENT); String markupSyntax = getDefaultSyntax(); WikiContext wikiContext= Utils.setUpWikiContext(wikiPortlet); if (markup == null) { markup = (markupInput.getValue() == null) ? "" : markupInput.getValue(); } String xhtmlContent = renderingService.render(markup, markupSyntax, Syntax.ANNOTATED_XHTML_1_0.toIdString(), false); xhtmlContent = StringCommonUtils.encodeWikiScriptMarkup(xhtmlContent); richTextArea.getUIFormTextAreaInput().setValue(xhtmlContent); session.setAttribute(UIWikiRichTextArea.SESSION_KEY, xhtmlContent); session.setAttribute(UIWikiRichTextArea.WIKI_CONTEXT, wikiContext); ExoContainer container = ExoContainerContext.getCurrentContainer(); SessionManager sessionManager = (SessionManager) container.getComponentInstanceOfType(SessionManager.class); sessionManager.addSessionContext(session.getId(), Utils.createWikiContext(wikiPortlet)); sessionManager.addSessionContext(ConversationState.getCurrent().getIdentity().getUserId(), Utils.createWikiContext(wikiPortlet)); if (sessionManager.getSessionContainer(session.getId()) != null) { sessionManager.addSessionContainer(ConversationState.getCurrent().getIdentity().getUserId(), sessionManager.getSessionContainer(session.getId())); } }