Added missing check for an empty editor on edit
authorAlexander Ebert <ebert@woltlab.com>
Mon, 18 Dec 2017 10:53:40 +0000 (11:53 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Mon, 18 Dec 2017 10:53:40 +0000 (11:53 +0100)
wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Comment/Edit.js

index 64e18ab485e95cbe49b42221525bc30a9a0543ae..a01b0671f964f6bcde5de2922cda4a4aac32f8a2 100644 (file)
@@ -230,6 +230,13 @@ define(
                        // remove all existing error elements
                        elBySelAll('.innerError', this._activeElement, elRemove);
                        
+                       // check if editor contains actual content
+                       var editorElement = elById(this._getEditorId());
+                       if (window.jQuery(editorElement).data('redactor').utils.isEmpty()) {
+                               this.throwError(editorElement, Language.get('wcf.global.form.error.empty'));
+                               return false;
+                       }
+                       
                        var data = {
                                api: this,
                                parameters: parameters,