Skip to content

Commit

Permalink
CKEDITOR-475: Add form token check to HTMLConverter
Browse files Browse the repository at this point in the history
  • Loading branch information
michitux committed Jul 5, 2022
1 parent e6932ba commit 6b10531
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Expand Up @@ -60,7 +60,8 @@
htmlConverter: sourceDocument.getURL('get', $.param({
sheet: 'CKEditor.HTMLConverter',
outputSyntax: 'plain',
language: $('html').attr('lang') || ''
language: $('html').attr('lang') || '',
formToken: document.documentElement.dataset.xwikiFormToken || ''
}))
}, editor.config['xwiki-source']);

Expand Down
Expand Up @@ -41,7 +41,7 @@
{{velocity wiki="false"}}
#set ($toHTML = $request.toHTML == 'true')
#set ($fromHTML = $request.fromHTML == 'true')
#if ($toHTML || $fromHTML)
#if (($toHTML || $fromHTML) && $services.csrf.isTokenValid($request.formToken))
#set ($text = "$!request.text")
#set ($stripHTMLEnvelope = $request.stripHTMLEnvelope == 'true')
#set ($output = "#ckeditor_convert($text $toHTML $fromHTML $stripHTMLEnvelope)")
Expand Down

0 comments on commit 6b10531

Please sign in to comment.