Fixed work-around for smiley codes
authorAlexander Ebert <ebert@woltlab.com>
Wed, 28 Dec 2016 17:06:19 +0000 (18:06 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Wed, 28 Dec 2016 17:06:19 +0000 (18:06 +0100)
wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabClean.js

index 9736d864c13b3beb0f1f7ff7470dc2757bc6103e..97a6c2fb60263d35a7e3a9e5c5ae75098cc85cd5 100644 (file)
@@ -170,10 +170,9 @@ $.Redactor.prototype.WoltLabClean = function() {
                                        img.removeAttribute('style');
                                        
                                        if (img.hasAttribute('alt')) {
-                                               // The editor trips over `<`, causing the DOM to be seriously
-                                               // messed up. Until this is resolved, we're simply dropping it,
-                                               // at least for smilies it is later restored.
-                                               img.setAttribute('alt', img.getAttribute('alt').replace(/</g, ''));
+                                               // Any smiley with an code that has `<` followed by
+                                               // a letter will cause the editor to fail.
+                                               img.setAttribute('alt', img.getAttribute('alt').replace(/</g, '&lt;'));
                                        }
                                });