Skip to content
Snippets Groups Projects

Issue #3303086: CKEditor does not work when big_pipe is used

Open Dominik Wille requested to merge issue/csp-3303086:3303086-ckeditor-does-not into 8.x-1.x
1 file
+ 8
2
Compare changes
  • Side-by-side
  • Inline
@@ -85,8 +85,14 @@ class CoreCspSubscriber implements EventSubscriberInterface {
// applied to calling page.
$quickedit = in_array('quickedit/quickedit', $libraries) && $this->moduleHandler->moduleExists('ckeditor');
// As Big Pipe can display forms later on the page, the CKEditor library
// may not be detected on main page response.
$big_pipe = in_array('big_pipe/big_pipe', $libraries)
&& $this->moduleHandler->moduleExists('big_pipe')
&& $this->moduleHandler->moduleExists('ckeditor');
// CKEditor requires script attribute on interface buttons.
if (in_array('core/ckeditor', $libraries) || $quickedit) {
if (in_array('core/ckeditor', $libraries) || $quickedit || $big_pipe) {
$policy->fallbackAwareAppendIfEnabled('script-src-elem', []);
$policy->fallbackAwareAppendIfEnabled('script-src', [Csp::POLICY_UNSAFE_INLINE]);
$policy->fallbackAwareAppendIfEnabled('script-src-attr', [Csp::POLICY_UNSAFE_INLINE]);
@@ -94,7 +100,7 @@ class CoreCspSubscriber implements EventSubscriberInterface {
// Inline style element is added by ckeditor.off-canvas-css-reset.js.
// @see https://www.drupal.org/project/drupal/issues/2952390
if (in_array('ckeditor/drupal.ckeditor', $libraries) || $quickedit) {
if (in_array('ckeditor/drupal.ckeditor', $libraries) || $quickedit || $big_pipe) {
$policy->fallbackAwareAppendIfEnabled('style-src', [Csp::POLICY_UNSAFE_INLINE]);
$policy->fallbackAwareAppendIfEnabled('style-src-attr', [Csp::POLICY_UNSAFE_INLINE]);
$policy->fallbackAwareAppendIfEnabled('style-src-elem', [Csp::POLICY_UNSAFE_INLINE]);
Loading