Modifications pour le document HTMLConverter

Modifié par Florent Charton le 2024/08/08 18:44

Depuis la version 1.1
modifié par superadmin
sur 2022/06/20 08:49
Commentaire de modification : Install extension [org.xwiki.contrib:application-ckeditor-ui/1.63.1]
À la version 2.1
modifié par Florent Charton
sur 2024/08/08 18:44
Commentaire de modification : Install extension [org.xwiki.platform:xwiki-platform-ckeditor-ui/15.10.11]

Résumé

Détails

Propriétés de la Page
Auteur du document
... ... @@ -1,1 +1,1 @@
1 -XWiki.superadmin
1 +xwiki:XWiki.fcharton
Contenu
... ... @@ -3,22 +3,11 @@
3 3  {{velocity wiki="false"}}
4 4  #set ($toHTML = $request.toHTML == 'true')
5 5  #set ($fromHTML = $request.fromHTML == 'true')
6 -#if ($toHTML || $fromHTML)
6 +#if (($toHTML || $fromHTML) && $services.csrf.isTokenValid($request.formToken))
7 7   #set ($text = "$!request.text")
8 8   #set ($stripHTMLEnvelope = $request.stripHTMLEnvelope == 'true')
9 9   #set ($output = "#ckeditor_convert($text $toHTML $fromHTML $stripHTMLEnvelope)")
10 - #set ($characterEncoding = 'utf-8')
11 - ## Make sure the Character Encoding response header matches the character encoding used to write the response and
12 - ## compute its length. See CKEDITOR-162: Cannot convert to source code
13 - #set ($discard = $response.setCharacterEncoding($characterEncoding))
14 - ## We write the output directly to the response to avoid the execution of the Rendering Transformations. Another
15 - ## option would be to specify which Rendering Transformations to execute in the query string (XWIKI-13167).
16 - ## See CKEDITOR-51: Icon transformations are saved by CKEditor
17 - #set ($discard = $response.writer.print($output))
18 - ## The content length is measured in bytes and one character can use more than one byte.
19 - #set ($discard = $response.setContentLength($output.getBytes($characterEncoding).size()))
20 - ## Make sure the entire content is send back to the client.
21 - #set ($discard = $response.flushBuffer())
10 + #rawResponse($output)
22 22  #else
23 23   The service used by the CKEditor source plugin to convert between HTML and wiki syntax.
24 24  #end