From 7ec18d54cc266a85786105f38785180fcd06ea44 Mon Sep 17 00:00:00 2001
From: Oliver Hader <oliver@typo3.org>
Date: Tue, 25 Jul 2023 10:03:35 +0200
Subject: [PATCH] [SECURITY] Mitigate XSS in CKEditor4 plugin wordcount

See
https://github.com/w8tcha/CKEditor-WordCount-Plugin/security/advisories/GHSA-q9w4-w667-qqj4

yarn add ckeditor-wordcount-plugin@^1.17.12

Resolves: #101234
Releases: 11.5
Change-Id: I7400bc7405a91e62fb7dc5b3565ee2f9d5b4cc06
Security-Bulletin: TYPO3-CORE-SA-2023-004
Security-References: CVE-2023-37905
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/80157
Tested-by: Oliver Hader <oliver.hader@typo3.org>
Reviewed-by: Oliver Hader <oliver.hader@typo3.org>
---
 Build/package.json                            |  2 +-
 Build/yarn.lock                               |  8 +--
 .../Contrib/plugins/wordcount/lang/ar.js      |  3 ++
 .../Contrib/plugins/wordcount/lang/ca.js      |  3 ++
 .../Contrib/plugins/wordcount/lang/cs.js      | 24 +++++----
 .../Contrib/plugins/wordcount/lang/da.js      |  3 ++
 .../Contrib/plugins/wordcount/lang/de.js      |  9 ++--
 .../Contrib/plugins/wordcount/lang/el.js      |  3 ++
 .../Contrib/plugins/wordcount/lang/es.js      |  9 ++--
 .../Contrib/plugins/wordcount/lang/fa.js      |  4 ++
 .../Contrib/plugins/wordcount/lang/fi.js      |  3 ++
 .../Contrib/plugins/wordcount/lang/fr.js      |  5 +-
 .../Contrib/plugins/wordcount/lang/he.js      |  3 ++
 .../Contrib/plugins/wordcount/lang/hr.js      |  3 ++
 .../Contrib/plugins/wordcount/lang/hu.js      |  3 ++
 .../Contrib/plugins/wordcount/lang/it.js      |  5 +-
 .../Contrib/plugins/wordcount/lang/ja.js      |  3 ++
 .../Contrib/plugins/wordcount/lang/ka.js      | 18 +++++++
 .../Contrib/plugins/wordcount/lang/nl.js      |  5 +-
 .../Contrib/plugins/wordcount/lang/no.js      |  3 ++
 .../Contrib/plugins/wordcount/lang/pl.js      |  3 ++
 .../Contrib/plugins/wordcount/lang/pt-br.js   |  9 ++--
 .../Contrib/plugins/wordcount/lang/pt.js      |  5 +-
 .../Contrib/plugins/wordcount/lang/ru.js      |  5 +-
 .../Contrib/plugins/wordcount/lang/sk.js      | 20 +++----
 .../Contrib/plugins/wordcount/lang/sv.js      |  6 ++-
 .../Contrib/plugins/wordcount/lang/tr.js      |  3 ++
 .../Contrib/plugins/wordcount/plugin.js       | 53 +++++++++++--------
 28 files changed, 161 insertions(+), 62 deletions(-)
 create mode 100644 typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Contrib/plugins/wordcount/lang/ka.js

diff --git a/Build/package.json b/Build/package.json
index a64b99473b4f..0913f82b4c0f 100644
--- a/Build/package.json
+++ b/Build/package.json
@@ -87,7 +87,7 @@
     "broadcastchannel-polyfill": "^1.0.0",
     "chart.js": "^2.9.3",
     "chosen-js": "^1.8.7",
-    "ckeditor-wordcount-plugin": "^1.17.6",
+    "ckeditor-wordcount-plugin": "^1.17.12",
     "ckeditor4": "^4.18.0",
     "codemirror": "^5.58.1",
     "cropperjs": "^1.5.9",
diff --git a/Build/yarn.lock b/Build/yarn.lock
index 0a9f64cb805a..13636e6ed126 100644
--- a/Build/yarn.lock
+++ b/Build/yarn.lock
@@ -1929,10 +1929,10 @@ circular-json@^0.3.1:
   resolved "https://registry.yarnpkg.com/circular-json/-/circular-json-0.3.3.tgz#815c99ea84f6809529d2f45791bdf82711352d66"
   integrity sha512-UZK3NBx2Mca+b5LsG7bY183pHWt5Y1xts4P3Pz7ENTwGVnJOUWbRb3ocjvX7hx9tq/yTAdclXm9sZ38gNuem4A==
 
-ckeditor-wordcount-plugin@^1.17.6:
-  version "1.17.6"
-  resolved "https://registry.yarnpkg.com/ckeditor-wordcount-plugin/-/ckeditor-wordcount-plugin-1.17.6.tgz#cb1a2a988ce8c3f29cd701f38b120c3a03daef85"
-  integrity sha512-73Q0/W445UoToQ8fyaBhXxhsZXMOxoeGGaIZ1HyiPc1nisK1gbIGAFi1ksgKoavQhri0+sOfpnYSFXDEC608EQ==
+ckeditor-wordcount-plugin@^1.17.12:
+  version "1.17.12"
+  resolved "https://registry.yarnpkg.com/ckeditor-wordcount-plugin/-/ckeditor-wordcount-plugin-1.17.12.tgz#09452308b460398d7b045efb69b240242a5150f5"
+  integrity sha512-UU6ZpNoJvo6TQ7LoiV1hcEWboHKwqoLKK0CW951ZXH2QywMX+b4FkYNk3ajdrkCWbe2jVT2kbyMHf/H4FK+u8w==
 
 ckeditor4@^4.18.0:
   version "4.18.0"
diff --git a/typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Contrib/plugins/wordcount/lang/ar.js b/typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Contrib/plugins/wordcount/lang/ar.js
index 7c181a4cdf55..bcf1f2ecf35a 100644
--- a/typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Contrib/plugins/wordcount/lang/ar.js
+++ b/typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Contrib/plugins/wordcount/lang/ar.js
@@ -2,8 +2,11 @@
 
 CKEDITOR.plugins.setLang('wordcount', 'ar', {
     WordCount: 'كلمات:',
+    WordCountRemaining: 'Words remaining',
     CharCount: 'حروف:',
+    CharCountRemaining: 'Characters remaining',
     CharCountWithHTML: 'حروف مع إتش تي إم إل',
+    CharCountWithHTMLRemaining: 'Characters (with HTML) remaining',
     Paragraphs: 'فقرات',
     ParagraphsRemaining: 'Paragraphs remaining',
     pasteWarning: 'لا يمكن اضافة هذا المحتوى لانه تجاوز الحد الاقصى',
diff --git a/typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Contrib/plugins/wordcount/lang/ca.js b/typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Contrib/plugins/wordcount/lang/ca.js
index 19f67c458770..0350138b262e 100644
--- a/typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Contrib/plugins/wordcount/lang/ca.js
+++ b/typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Contrib/plugins/wordcount/lang/ca.js
@@ -4,8 +4,11 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
 */
 CKEDITOR.plugins.setLang('wordcount', 'ca', {
     WordCount: 'Paraules:',
+    WordCountRemaining: 'Words remaining',
     CharCount: 'Caràcters:',
+    CharCountRemaining: 'Characters remaining',
     CharCountWithHTML: 'Caràcters (including HTML):',
+    CharCountWithHTMLRemaining: 'Characters (with HTML) remaining',
     Paragraphs: 'Paragraphs:',
     ParagraphsRemaining: 'Paragraphs remaining',
     pasteWarning: 'Content can not be pasted because it is above the allowed limit',
diff --git a/typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Contrib/plugins/wordcount/lang/cs.js b/typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Contrib/plugins/wordcount/lang/cs.js
index 6dbd0bf4a48f..e39f96bd64a7 100644
--- a/typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Contrib/plugins/wordcount/lang/cs.js
+++ b/typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Contrib/plugins/wordcount/lang/cs.js
@@ -2,14 +2,16 @@
 Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
 For licensing, see LICENSE.html or http://ckeditor.com/license
 */
-CKEDITOR.plugins.setLang('wordcount', 'cs',
-    {
-        WordCount: 'Slov: ',
-        CharCount: 'Znaků: ',
-        CharCountWithHTML: 'Znaků (s HTML): ',
-        Paragraphs: 'Odstavců: ',
-        ParagraphsRemaining: 'Paragraphs remaining',
-        pasteWarning: 'Obsah nelze vložit',
-        Selected: 'Výběr: ',
-        title: 'Statistika'
-    });
\ No newline at end of file
+CKEDITOR.plugins.setLang('wordcount', 'cs', {
+    WordCount: 'Slov: ',
+    WordCountRemaining: 'Words remaining',
+    CharCount: 'Znaků: ',
+    CharCountRemaining: 'Characters remaining',
+    CharCountWithHTML: 'Znaků (s HTML): ',
+    CharCountWithHTMLRemaining: 'Characters (with HTML) remaining',
+    Paragraphs: 'Odstavců: ',
+    ParagraphsRemaining: 'Paragraphs remaining',
+    pasteWarning: 'Obsah nelze vložit',
+    Selected: 'Výběr: ',
+    title: 'Statistika'
+});
\ No newline at end of file
diff --git a/typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Contrib/plugins/wordcount/lang/da.js b/typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Contrib/plugins/wordcount/lang/da.js
index aaf781a41b6f..3d334a697d23 100644
--- a/typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Contrib/plugins/wordcount/lang/da.js
+++ b/typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Contrib/plugins/wordcount/lang/da.js
@@ -4,8 +4,11 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
 */
 CKEDITOR.plugins.setLang('wordcount', 'da', {
     WordCount: 'Ord:',
+    WordCountRemaining: 'Words remaining',
     CharCount: 'Karakterer:',
+    CharCountRemaining: 'Characters remaining',
     CharCountWithHTML: 'Karakterer (med HTML):',
+    CharCountWithHTMLRemaining: 'Characters (with HTML) remaining',
     Paragraphs: 'Afsnit:',
     ParagraphsRemaining: 'Paragraphs remaining',
     pasteWarning: 'Indholdet kan ikke indsættes da det er længere end den tilladte grænse.',
diff --git a/typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Contrib/plugins/wordcount/lang/de.js b/typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Contrib/plugins/wordcount/lang/de.js
index 42e298dead74..d63fe7ec6a9d 100644
--- a/typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Contrib/plugins/wordcount/lang/de.js
+++ b/typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Contrib/plugins/wordcount/lang/de.js
@@ -4,11 +4,14 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
 */
 CKEDITOR.plugins.setLang('wordcount', 'de', {
     WordCount: 'Wörter:',
+    WordCountRemaining: 'Verbleibende Wörter',
     CharCount: 'Zeichen:',
+    CharCountRemaining: 'Verbleibende Zeichen',
     CharCountWithHTML: 'Zeichen (inkl. HTML):',
+    CharCountWithHTMLRemaining: 'Verbleibende Zeichen (inkl. HTML)',
     Paragraphs: 'Absätze:',
-    ParagraphsRemaining: 'Paragraphs remaining',
-    pasteWarning: 'Content can not be pasted because it is above the allowed limit',
-    Selected: 'Selected: ',
+    ParagraphsRemaining: 'Verbleibende Absätze',
+    pasteWarning: 'Text kann nicht eingefügt werden. Text ist zu lang.',
+    Selected: 'Ausgewählt: ',
     title: 'Statistik'
 });
diff --git a/typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Contrib/plugins/wordcount/lang/el.js b/typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Contrib/plugins/wordcount/lang/el.js
index 2643c225e01c..ef57dcef9860 100644
--- a/typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Contrib/plugins/wordcount/lang/el.js
+++ b/typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Contrib/plugins/wordcount/lang/el.js
@@ -4,8 +4,11 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
 */
 CKEDITOR.plugins.setLang('wordcount', 'el', {
     WordCount: 'Λέξεις:',
+    WordCountRemaining: 'Words remaining',
     CharCount: 'Χαρακτήρες:',
+    CharCountRemaining: 'Characters remaining',
     CharCountWithHTML: 'Χαρακτήρες (μαζί με HTML):',
+    CharCountWithHTMLRemaining: 'Characters (with HTML) remaining',
     Paragraphs: 'Paragraphs:',
     ParagraphsRemaining: 'Paragraphs remaining',
     pasteWarning: 'Content can not be pasted because it is above the allowed limit',
diff --git a/typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Contrib/plugins/wordcount/lang/es.js b/typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Contrib/plugins/wordcount/lang/es.js
index 8cd41ff367fd..3bbc877d60ae 100644
--- a/typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Contrib/plugins/wordcount/lang/es.js
+++ b/typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Contrib/plugins/wordcount/lang/es.js
@@ -4,10 +4,13 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
 */
 CKEDITOR.plugins.setLang('wordcount', 'es', {
     WordCount: 'Palabras:',
-    CharCount: 'Carácteres:',
-    CharCountWithHTML: 'Carácteres (con HTML):',
+    WordCountRemaining: 'Palabras restantes',
+    CharCount: 'Caracteres:',
+    CharCountRemaining: 'Caracteres restantes',
+    CharCountWithHTML: 'Caracteres (con HTML):',
+    CharCountWithHTMLRemaining: 'Caracteres (con HTML) restantes',
     Paragraphs: 'Párrafos:',
-    ParagraphsRemaining: 'Paragraphs remaining',
+    ParagraphsRemaining: 'Párrafos restantes',
     pasteWarning: 'El contenido no se puede pegar, ya que se encuentra fuera del límite permitido',
     Selected: 'Seleccionado: ',
     title: 'Estadísticas'
diff --git a/typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Contrib/plugins/wordcount/lang/fa.js b/typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Contrib/plugins/wordcount/lang/fa.js
index e679255f22e2..3fdb800adb21 100644
--- a/typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Contrib/plugins/wordcount/lang/fa.js
+++ b/typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Contrib/plugins/wordcount/lang/fa.js
@@ -3,8 +3,12 @@ Its The Persian (Farsi) Language Translate For Iranian By "Mohsen Esmaili"
 */
 CKEDITOR.plugins.setLang('wordcount', 'fa', {
     WordCount: 'لغت:',
+    WordCountRemaining: 'Words remaining',
     CharCount: 'کاراکتر:',
+    CharCountRemaining: 'Characters remaining',
     CharCountWithHTML: 'کاراکترها (با HTML):',
+    CharCountWithHTMLRemaining: 'Characters (with HTML) remaining',
+    CharCountWithHTMLRemaining: 'Characters (with HTML) remaining',
     Paragraphs: 'پاراگراف:',
     ParagraphsRemaining: 'Paragraphs remaining',
     pasteWarning: 'محتوای مورد نظر را نمی توان چسباند. زیرا این بیشتر از حد مجاز است.',
diff --git a/typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Contrib/plugins/wordcount/lang/fi.js b/typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Contrib/plugins/wordcount/lang/fi.js
index 827a72f70b74..2e13478cec7f 100644
--- a/typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Contrib/plugins/wordcount/lang/fi.js
+++ b/typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Contrib/plugins/wordcount/lang/fi.js
@@ -5,8 +5,11 @@
  */
 CKEDITOR.plugins.setLang('wordcount', 'fi', {
     WordCount: 'Sanoja:',
+    WordCountRemaining: 'Words remaining',
     CharCount: 'Merkkejä:',
+    CharCountRemaining: 'Characters remaining',
     CharCountWithHTML: 'Merkkejä (ml. HTML):',
+    CharCountWithHTMLRemaining: 'Characters (with HTML) remaining',
     Paragraphs: 'Kappaleita:',
     ParagraphsRemaining: 'Paragraphs remaining',
     pasteWarning: 'Sisältöä ei voida liittää, koska se ylittää sallitun rajan.',
diff --git a/typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Contrib/plugins/wordcount/lang/fr.js b/typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Contrib/plugins/wordcount/lang/fr.js
index 1fa562b1901a..c404a161ebe7 100644
--- a/typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Contrib/plugins/wordcount/lang/fr.js
+++ b/typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Contrib/plugins/wordcount/lang/fr.js
@@ -2,10 +2,13 @@
 
 CKEDITOR.plugins.setLang('wordcount', 'fr', {
     WordCount: 'Mots :',
+    WordCountRemaining: 'mots restants',
     CharCount: 'Caractères :',
+    CharCountRemaining: 'caractères restants',
     CharCountWithHTML: 'Caractères (incluant HTML) :',
+    CharCountWithHTMLRemaining: 'caractères (avec HTML) restants',
     Paragraphs: 'Paragraphes :',
-    ParagraphsRemaining: 'Paragraphs remaining',
+    ParagraphsRemaining: 'paragraphes restants',
     pasteWarning: 'Le contenu ne peut pas être collé car il dépasse la limite autorisée',
     Selected: 'Sélectionné :',
     title: 'Statistiques'
diff --git a/typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Contrib/plugins/wordcount/lang/he.js b/typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Contrib/plugins/wordcount/lang/he.js
index 43895e0a4bf2..652fcd19e407 100644
--- a/typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Contrib/plugins/wordcount/lang/he.js
+++ b/typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Contrib/plugins/wordcount/lang/he.js
@@ -4,8 +4,11 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
 */
 CKEDITOR.plugins.setLang('wordcount', 'he', {
     WordCount: 'מילים:',
+    WordCountRemaining: 'Words remaining',
     CharCount: 'תווים:',
+    CharCountRemaining: 'Characters remaining',
     CharCountWithHTML: 'תווים (כולל HTML):',
+    CharCountWithHTMLRemaining: 'Characters (with HTML) remaining',
     Paragraphs: 'פסקאות:',
     ParagraphsRemaining: 'Paragraphs remaining',
     pasteWarning: 'לא ניתן להדביק תוכן בשל עודף תווים',
diff --git a/typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Contrib/plugins/wordcount/lang/hr.js b/typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Contrib/plugins/wordcount/lang/hr.js
index b66d154e2d15..4e501ccb3ce7 100644
--- a/typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Contrib/plugins/wordcount/lang/hr.js
+++ b/typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Contrib/plugins/wordcount/lang/hr.js
@@ -4,8 +4,11 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
 */
 CKEDITOR.plugins.setLang("wordcount", "hr", {
     WordCount: "Riječi:",
+    WordCountRemaining: 'Words remaining',
     CharCount: "Znakova:",
+    CharCountRemaining: 'Characters remaining',
     CharCountWithHTML: "Znakova (uključujući HTML):",
+    CharCountWithHTMLRemaining: 'Characters (with HTML) remaining',
     Paragraphs: "Paragraphs:",
     ParagraphsRemaining: "Paragraphs remaining",
     pasteWarning: "Content can not be pasted because it is above the allowed limit",
diff --git a/typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Contrib/plugins/wordcount/lang/hu.js b/typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Contrib/plugins/wordcount/lang/hu.js
index 7866a8e9086f..1e19fc680f39 100644
--- a/typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Contrib/plugins/wordcount/lang/hu.js
+++ b/typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Contrib/plugins/wordcount/lang/hu.js
@@ -4,8 +4,11 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
 */
 CKEDITOR.plugins.setLang('wordcount', 'hu', {
     WordCount: 'Szavak:',
+    WordCountRemaining: 'Words remaining',
     CharCount: 'Karakaterek:',
+    CharCountRemaining: 'Characters remaining',
     CharCountWithHTML: 'Karakterek (HTML tagekkel):',
+    CharCountWithHTMLRemaining: 'Characters (with HTML) remaining',
     Paragraphs: 'Bekezdések:',
     ParagraphsRemaining: 'Paragraphs remaining',
     pasteWarning: 'A szöveget nem lehet beilleszteni, mert a megadott limit felett van',
diff --git a/typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Contrib/plugins/wordcount/lang/it.js b/typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Contrib/plugins/wordcount/lang/it.js
index 07717265ed04..6c6a4a6502ec 100644
--- a/typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Contrib/plugins/wordcount/lang/it.js
+++ b/typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Contrib/plugins/wordcount/lang/it.js
@@ -5,10 +5,13 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
 */
 CKEDITOR.plugins.setLang('wordcount', 'it', {
     WordCount: 'Parole:',
+    WordCountRemaining: 'Parole rimanenti',
     CharCount: 'Caratteri:',
+    CharCountRemaining: 'Caratteri rimanenti',
     CharCountWithHTML: 'Caratteri (HTML incluso):',
+    CharCountWithHTMLRemaining: 'Caratteri (con HTML) rimanenti',
     Paragraphs: 'Paragrafi:',
-    ParagraphsRemaining: 'Paragraphs remaining',
+    ParagraphsRemaining: 'Paragrafi rimanenti',
     pasteWarning: 'Il contenuto non può essere incollato poiché supera il limite massimo di caratteri disponibili',
     Selected: 'Selezionato: ',
     title: 'Statistiche'
diff --git a/typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Contrib/plugins/wordcount/lang/ja.js b/typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Contrib/plugins/wordcount/lang/ja.js
index 1d02684ab288..3c89d4af6fc8 100644
--- a/typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Contrib/plugins/wordcount/lang/ja.js
+++ b/typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Contrib/plugins/wordcount/lang/ja.js
@@ -4,8 +4,11 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
 */
 CKEDITOR.plugins.setLang('wordcount', 'ja', {
     WordCount: '単語数:',
+    WordCountRemaining: 'Words remaining',
     CharCount: '文字数:',
+    CharCountRemaining: 'Characters remaining',
     CharCountWithHTML: '文字数 (HTMLタグを含む):',
+    CharCountWithHTMLRemaining: 'Characters (with HTML) remaining',
     Paragraphs: '段落数:',
     ParagraphsRemaining: 'Paragraphs remaining',
     pasteWarning: '文字数/単語数の上限を超えるため、貼り付けできません。',
diff --git a/typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Contrib/plugins/wordcount/lang/ka.js b/typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Contrib/plugins/wordcount/lang/ka.js
new file mode 100644
index 000000000000..187203254381
--- /dev/null
+++ b/typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Contrib/plugins/wordcount/lang/ka.js
@@ -0,0 +1,18 @@
+/*
+Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+GEO Translation by E404R
+*/
+CKEDITOR.plugins.setLang('wordcount', 'ka', {
+    WordCount: 'სიტყვები:',
+    WordCountRemaining: 'დარჩენილი სიტყვები',
+    CharCount: 'სიმბოლო:',
+    CharCountRemaining: 'დარჩენილი სიმბოლო',
+    CharCountWithHTML: 'სიმბოლოები (HTML ით):',
+    CharCountWithHTMLRemaining: 'სიმბოლოები (HTML ით) დარჩენილი',
+    Paragraphs: 'პარაგრაფი:',
+    ParagraphsRemaining: 'დარჩენილი პარაგრაფი',
+    pasteWarning: 'ჩასმა შეუძლებელია, რადგან ის აღემატება დასაშვებ ლიმიტს',
+    Selected: 'არჩეული: ',
+    title: 'სტატისტიკა'
+});
diff --git a/typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Contrib/plugins/wordcount/lang/nl.js b/typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Contrib/plugins/wordcount/lang/nl.js
index e2a81701fd9a..7b732ddc14d0 100644
--- a/typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Contrib/plugins/wordcount/lang/nl.js
+++ b/typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Contrib/plugins/wordcount/lang/nl.js
@@ -4,10 +4,13 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
 */
 CKEDITOR.plugins.setLang('wordcount', 'nl', {
     WordCount: 'Woorden:',
+    WordCountRemaining: 'Resterende woorden',
     CharCount: 'Tekens:',
+    CharCountRemaining: 'Resterende tekens',
     CharCountWithHTML: 'Tekens (inclusief HTML):',
+    CharCountWithHTMLRemaining: 'Resterende tekens (met HTML)',
     Paragraphs: 'Paragrafen:',
-    ParagraphsRemaining: 'Paragraphs remaining',
+    ParagraphsRemaining: 'Resterende paragrafen',
     pasteWarning: 'De tekst kan niet worden geplakt omdat de limiet is overschreden',
     Selected: 'Geselecteerd: ',
     title: 'Statistieken'
diff --git a/typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Contrib/plugins/wordcount/lang/no.js b/typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Contrib/plugins/wordcount/lang/no.js
index e9fba5c45f92..91744f9121a3 100644
--- a/typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Contrib/plugins/wordcount/lang/no.js
+++ b/typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Contrib/plugins/wordcount/lang/no.js
@@ -1,8 +1,11 @@
 // Norwegian translation by Vegard S.
 CKEDITOR.plugins.setLang('wordcount', 'no', {
     WordCount: 'Ord:',
+    WordCountRemaining: 'Words remaining',
     CharCount: 'Tegn:',
+    CharCountRemaining: 'Characters remaining',
     CharCountWithHTML: 'Tegn (including HTML):',
+    CharCountWithHTMLRemaining: 'Characters (with HTML) remaining',
     Paragraphs: 'Paragraphs:',
     ParagraphsRemaining: 'Paragraphs remaining',
     pasteWarning: 'Content can not be pasted because it is above the allowed limit',
diff --git a/typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Contrib/plugins/wordcount/lang/pl.js b/typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Contrib/plugins/wordcount/lang/pl.js
index cc742442a6e8..27481ce068b0 100644
--- a/typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Contrib/plugins/wordcount/lang/pl.js
+++ b/typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Contrib/plugins/wordcount/lang/pl.js
@@ -4,8 +4,11 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
 */
 CKEDITOR.plugins.setLang('wordcount', 'pl', {
     WordCount: 'Słów:',
+    WordCountRemaining: 'Words remaining',
     CharCount: 'Znaków:',
+    CharCountRemaining: 'Characters remaining',
     CharCountWithHTML: 'Znaków (wraz z kodem HTML):',
+    CharCountWithHTMLRemaining: 'Characters (with HTML) remaining',
     Paragraphs: 'Paragrafy:',
     ParagraphsRemaining: 'Paragraphs remaining',
     pasteWarning: 'Zawartość nie może zostać wklejona, ponieważ przekracza dozwolony limit',
diff --git a/typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Contrib/plugins/wordcount/lang/pt-br.js b/typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Contrib/plugins/wordcount/lang/pt-br.js
index da5b7a596f8d..1676d7b6c417 100644
--- a/typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Contrib/plugins/wordcount/lang/pt-br.js
+++ b/typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Contrib/plugins/wordcount/lang/pt-br.js
@@ -4,10 +4,13 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
 */
 CKEDITOR.plugins.setLang('wordcount', 'pt-br', {
     WordCount: 'Contagem de palavras:',
-    CharCount: 'Contagem de carateres:',
-    CharCountWithHTML: 'Carateres (incluindo HTML):',
+    WordCountRemaining: 'Palavras restantes',
+    CharCount: 'Contagem de caracteres:',
+    CharCountRemaining: 'Caracteres restantes',
+    CharCountWithHTML: 'Caracteres (incluindo HTML):',
+    CharCountWithHTMLRemaining: 'Caracteres (com HTML) restantes',
     Paragraphs: 'Parágrafos:',
-    ParagraphsRemaining: 'Paragraphs remaining',
+    ParagraphsRemaining: 'Parágrafos restantes',
     pasteWarning: 'Conteúdo não pode ser colado porque ultrapassa o limite permitido',
     Selected: 'Selecionado: ',
     title: 'Estatísticas'
diff --git a/typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Contrib/plugins/wordcount/lang/pt.js b/typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Contrib/plugins/wordcount/lang/pt.js
index 5fd624b22ca7..d41418b758f3 100644
--- a/typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Contrib/plugins/wordcount/lang/pt.js
+++ b/typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Contrib/plugins/wordcount/lang/pt.js
@@ -1,9 +1,12 @@
 CKEDITOR.plugins.setLang('wordcount', 'pt', {
     WordCount: 'Palavras:',
+    WordCountRemaining: 'Palavras remanescentes',
     CharCount: 'Caracteres:',
+    CharCountRemaining: 'Caracteres remanescentes',
     CharCountWithHTML: 'Carateres (incluindo HTML):',
+    CharCountWithHTMLRemaining: 'Caracteres (com HTML) remanescentes',
     Paragraphs: 'Parágrafos:',
-    ParagraphsRemaining: 'Paragraphs remaining',
+    ParagraphsRemaining: 'Parágrafos remanescentes',
     pasteWarning: 'O conteúdo não pode ser colado porque ultrapassa o limite permitido',
     Selected: 'Selecionado: ',
     title: 'Estatísticas'
diff --git a/typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Contrib/plugins/wordcount/lang/ru.js b/typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Contrib/plugins/wordcount/lang/ru.js
index fd51b9323ac5..a4e6a7023b36 100644
--- a/typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Contrib/plugins/wordcount/lang/ru.js
+++ b/typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Contrib/plugins/wordcount/lang/ru.js
@@ -4,10 +4,13 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
 */
 CKEDITOR.plugins.setLang('wordcount', 'ru', {
     WordCount: 'Слов:',
+    WordCountRemaining: 'слов(-а) осталось',
     CharCount: 'Символов:',
+    CharCountRemaining: 'символов(-а) осталось',
     CharCountWithHTML: ' (включая HTML-разметку):',
+    CharCountWithHTMLRemaining: 'символов(-а) (включая HTML) осталось',
     Paragraphs: 'Параграфов:',
-    ParagraphsRemaining: 'Параграфов осталось',
+    ParagraphsRemaining: 'параграфов осталось',
     pasteWarning: 'Контент не может быть вставлен, т.к. привышает допустимый лимит',
     Selected: 'Выделено: ',
     title: 'Статистика'
diff --git a/typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Contrib/plugins/wordcount/lang/sk.js b/typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Contrib/plugins/wordcount/lang/sk.js
index 70eeb3aafa52..b0acc7fc1c4f 100644
--- a/typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Contrib/plugins/wordcount/lang/sk.js
+++ b/typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Contrib/plugins/wordcount/lang/sk.js
@@ -3,13 +3,15 @@ Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
 For licensing, see LICENSE.html or http://ckeditor.com/license
 */
 CKEDITOR.plugins.setLang('wordcount', 'sk', {
-      WordCount: 'Slov:',
-      CharCount: 'Znakov:',
-      CharCountWithHTML: 'Znakov (vrátane HTML):',
+    WordCount: 'Slov:',
+    WordCountRemaining: 'Words remaining',
+    CharCount: 'Znakov:',
+    CharCountRemaining: 'Characters remaining',
+    CharCountWithHTML: 'Znakov (vrátane HTML):',
+    CharCountWithHTMLRemaining: 'Characters (with HTML) remaining',
     Paragraphs: 'Odstavcov:',
-      ParagraphsRemaining: 'Paragraphs remaining',
-      pasteWarning: 'Obsah sa nedá prilepiť.',
-      Selected: 'Výber: ',
-      title: 'Å tatistika'
-});
-
+    ParagraphsRemaining: 'Paragraphs remaining',
+    pasteWarning: 'Obsah sa nedá prilepiť.',
+    Selected: 'Výber: ',
+    title: 'Å tatistika'
+});
\ No newline at end of file
diff --git a/typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Contrib/plugins/wordcount/lang/sv.js b/typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Contrib/plugins/wordcount/lang/sv.js
index 33509171fd37..cf7a9f04c096 100644
--- a/typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Contrib/plugins/wordcount/lang/sv.js
+++ b/typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Contrib/plugins/wordcount/lang/sv.js
@@ -4,11 +4,13 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
 */
 CKEDITOR.plugins.setLang('wordcount', 'sv', {
     WordCount: 'Ord:',
+    WordCountRemaining: 'ord kvar',
     CharCount: 'Tecken:',
-    CharCountRemaining: 'tecken återstår',
+    CharCountRemaining: 'tecken kvar',
     CharCountWithHTML: 'Tecken (inklusive HTML):',
+    CharCountWithHTMLRemaining: 'tecken (med html) kvar',
     Paragraphs: 'Paragraf:',
-    ParagraphsRemaining: 'Paragraphs remaining',
+    ParagraphsRemaining: 'stycken kvar',
     pasteWarning: 'Innehåll kan inte klistras in eftersom det överskrider den tillåtna gränsen',
     Selected: 'Valt: ',
     title: 'Statistik'
diff --git a/typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Contrib/plugins/wordcount/lang/tr.js b/typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Contrib/plugins/wordcount/lang/tr.js
index e916533b3015..6e5a74e317e4 100644
--- a/typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Contrib/plugins/wordcount/lang/tr.js
+++ b/typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Contrib/plugins/wordcount/lang/tr.js
@@ -4,8 +4,11 @@ mesut.cakir@hotmail.com.tr
 */
 CKEDITOR.plugins.setLang('wordcount', 'tr', {
     WordCount: 'Kelime:',
+    WordCountRemaining: 'Words remaining',
     CharCount: 'Karakter:',
+    CharCountRemaining: 'Characters remaining',
     CharCountWithHTML: 'Karakter (HTML dahil):',
+    CharCountWithHTMLRemaining: 'Characters (with HTML) remaining',
     Paragraphs: 'Paragraf:',
     ParagraphsRemaining: 'Paragraphs remaining',
     pasteWarning: 'Content can not be pasted because it is above the allowed limit',
diff --git a/typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Contrib/plugins/wordcount/plugin.js b/typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Contrib/plugins/wordcount/plugin.js
index 66535bb379b8..e2e608bc5aba 100644
--- a/typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Contrib/plugins/wordcount/plugin.js
+++ b/typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Contrib/plugins/wordcount/plugin.js
@@ -5,8 +5,8 @@
 
 CKEDITOR.plugins.add("wordcount",
     {
-        lang: "ar,bg,ca,cs,da,de,el,en,es,eu,fa,fi,fr,he,hr,hu,it,ko,ja,nl,no,pl,pt,pt-br,ru,sk,sv,tr,uk,zh-cn,zh,ro", // %REMOVE_LINE_CORE%
-        version: "1.17.7",
+        lang: "ar,bg,ca,cs,da,de,el,en,es,eu,fa,fi,fr,he,hr,hu,it,ka,ko,ja,nl,no,pl,pt,pt-br,ru,sk,sv,tr,uk,zh-cn,zh,ro", // %REMOVE_LINE_CORE%
+        version: "1.17.12",
         requires: "htmlwriter,notification,undo",
         bbcodePluginLoaded: false,
         onLoad: function() {
@@ -175,18 +175,16 @@ CKEDITOR.plugins.add("wordcount",
                     return html.replace(/\[.*?\]/gi, "");
                 }
 
-                var tmp = document.createElement("div");
-
                 // Add filter before strip
                 html = filter(html);
 
-                tmp.innerHTML = html;
-
-                if (tmp.textContent == "" && typeof tmp.innerText == "undefined") {
+                // Parse filtered HTML, without applying it to any element in DOM
+                var tmp = new DOMParser().parseFromString(html, 'text/html');
+                if (!tmp.body || !tmp.body.textContent) {
                     return "";
                 }
 
-                return tmp.textContent || tmp.innerText;
+                return tmp.body.textContent || tmp.body.innerText;
             }
 
             /**
@@ -255,8 +253,15 @@ CKEDITOR.plugins.add("wordcount",
             }
 
             function countWords(text) {
-                var normalizedText = text.replace(/(\r\n|\n|\r)/gm, " ").replace(/^\s+|\s+$/g, "")
-                    .replace("&nbsp;", " ");
+                
+                /**
+                 * we may end up with a couple of extra spaces in a row with all these replacements, but that's ok 
+                 * since we're going to split on one or more delimiters when we generate the words array
+                 **/
+                var normalizedText = text.replace(/(<([^>]+)>)/ig, " ")    //replace html tags, i think?
+                    .replace(/(\r\n|\n|\r)/gm, " ")                        //replace new lines(in many forms)
+                    .replace(/^\s+|\s+$/g, " ")                            //replace leading or trailing multiple spaces
+                    .replace("&nbsp;", " ");                               //replace html entities indicating a space
 
                 normalizedText = strip(normalizedText);
 
@@ -279,7 +284,13 @@ CKEDITOR.plugins.add("wordcount",
 
                 if (!config.warnOnLimitOnly) {
                     if (config.hardLimit) {
-                        editorInstance.execCommand("undo");
+                        if (editor.mode === "source" && editor.plugins.codemirror) {
+                            window["codemirror_" + editor.id].undo();
+                        } else {
+                            editorInstance.execCommand("undo");
+                            editorInstance.execCommand("undo");
+                        }
+                           
                     }
                 }
 
@@ -455,12 +466,14 @@ CKEDITOR.plugins.add("wordcount",
             }
 
             editor.on("key",
-                function(event) {
+                function (event) {
+                    var ms = isCloseToLimits() ? 5 : 250;
+
                     if (editor.mode === "source") {
                         clearTimeout(timeoutId);
                         timeoutId = setTimeout(
                             updateCounter.bind(this, event.editor),
-                            250
+                            ms
                         );
                     }
 
@@ -468,13 +481,11 @@ CKEDITOR.plugins.add("wordcount",
                         clearTimeout(timeoutId);
                         timeoutId = setTimeout(
                             updateCounter.bind(this, event.editor),
-                            250
+                            ms
                         );
                     }
                 },
-                editor,
-                null,
-                100);
+                editor);
 
             editor.on("change",
                 function(event) {
@@ -485,9 +496,7 @@ CKEDITOR.plugins.add("wordcount",
                         ms
                     );
                 },
-                editor,
-                null,
-                100);
+                editor);
 
             editor.on("uiSpace",
                 function (event) {
@@ -542,7 +551,9 @@ CKEDITOR.plugins.add("wordcount",
                             paragraphs = -1;
 
                         var mySelection = event.editor.getSelection(),
-                            selectedText = mySelection.getNative().toString().trim();
+                            selectedText = mySelection.getNative() 
+                              ? mySelection.getNative().toString().trim()
+                              : '';
 
 
                         // BeforeGetData and getData events are fired when calling
-- 
GitLab