[BUGFIX] Adjust modal window processing 08/59108/4
authorOliver Hader <oliver@typo3.org>
Tue, 11 Dec 2018 11:47:39 +0000 (12:47 +0100)
committerOliver Hader <oliver.hader@typo3.org>
Tue, 11 Dec 2018 12:31:39 +0000 (13:31 +0100)
Resolves: #87123
Releases: master, 8.7, 7.6
Change-Id: Idceecb174682261b967ea284e12e1836bb7e7bea
Reviewed-on: https://review.typo3.org/59108
Reviewed-by: Oliver Hader <oliver.hader@typo3.org>
Tested-by: Oliver Hader <oliver.hader@typo3.org>
typo3/sysext/backend/Resources/Private/TypeScript/ImageManipulation.ts
typo3/sysext/backend/Resources/Public/JavaScript/ImageManipulation.js
typo3/sysext/backend/Resources/Public/JavaScript/Modal.js

index 74ac4fa..56846c2 100644 (file)
@@ -283,7 +283,7 @@ class ImageManipulation {
             currentModal.find('.t3js-modal-body').append(response).addClass('cropper');
           });
         },
-        content: '<div class="modal-loading">' + icon + '</div>',
+        content: $('<div class="modal-loading">').append(icon),
         size: Modal.sizes.full,
         style: Modal.styles.dark,
         title: modalTitle,
index b12a629..53e6397 100644 (file)
@@ -269,7 +269,7 @@ define(["require", "exports", "TYPO3/CMS/Core/Contrib/imagesloaded.pkgd.min", "T
                             currentModal.find('.t3js-modal-body').append(response).addClass('cropper');
                         });
                     },
-                    content: '<div class="modal-loading">' + icon + '</div>',
+                    content: $('<div class="modal-loading">').append(icon),
                     size: Modal.sizes.full,
                     style: Modal.styles.dark,
                     title: modalTitle,
index 039162a..7041595 100644 (file)
@@ -236,15 +236,7 @@ define(['jquery',
     // Validation of configuration
     configuration.type = typeof configuration.type === 'string' && configuration.type in Modal.types ? configuration.type : Modal.defaultConfiguration.type;
     configuration.title = typeof configuration.title === 'string' ? configuration.title : Modal.defaultConfiguration.title;
-    if (typeof configuration.content === 'string') {
-      // A string means, no markup allowed, let's ensure this
-      configuration.content = securityUtility.encodeHtml(configuration.content);
-    } else if (typeof configuration.content === 'object') {
-      // An object means, a valid jQuery object with markup, let's get the markup
-      configuration.content = configuration.content.html();
-    } else {
-      configuration.content = Modal.defaultConfiguration.content;
-    }
+    configuration.content = typeof configuration.content === 'string' || typeof configuration.content === 'object' ? configuration.content : Modal.defaultConfiguration.content;
     configuration.severity = typeof configuration.severity !== 'undefined' ? configuration.severity : Modal.defaultConfiguration.severity;
     configuration.buttons = configuration.buttons || Modal.defaultConfiguration.buttons;
     configuration.size = typeof configuration.size === 'string' && configuration.size in Modal.sizes ? configuration.size : Modal.defaultConfiguration.size;
@@ -329,7 +321,9 @@ define(['jquery',
       if (typeof content === 'object') {
         currentModal.find(Modal.identifiers.body).append(content);
       } else {
-        content = $('<p />').html(content);
+        content = $('<p />').html(
+          securityUtility.encodeHtml(content)
+        );
         currentModal.find(Modal.identifiers.body).html(content);
       }
     }