Bladeren bron

If loaded CSEditor, then inline styles should be allowed

Visman 2 jaren geleden
bovenliggende
commit
6209d528ca
3 gewijzigde bestanden met toevoegingen van 10 en 4 verwijderingen
  1. 7 2
      app/Models/Page.php
  2. 2 0
      app/Models/Pages/PostFormTrait.php
  3. 1 2
      public/js/scloader.js

+ 7 - 2
app/Models/Page.php

@@ -403,8 +403,13 @@ abstract class Page extends Model
         foreach ($this->c->HTTP_HEADERS[$this->hhsLevel] as $header => $value) {
             if (
                 'Content-Security-Policy' === $header
-                && $this->c->isInit('Parser')
-                && $this->c->Parser->inlineStyle()
+                && (
+                    $this->needUnsafeInlineStyle
+                    || (
+                        $this->c->isInit('Parser')
+                        && $this->c->Parser->inlineStyle()
+                    )
+                )
             ) {
                 $value = $this->addUnsafeInline($value);
             }

+ 2 - 0
app/Models/Pages/PostFormTrait.php

@@ -336,6 +336,8 @@ trait PostFormTrait
 
                     unset($cur);
 
+                    $this->needUnsafeInlineStyle = true;
+
                     break 2;
                 }
             }

+ 1 - 2
public/js/scloader.js

@@ -32,8 +32,7 @@ ForkBB.editor = (function (doc, win) {
                 'left,center,right,justify|font,size,color,removeformat|' +
                 'bulletlist,orderedlist,indent,outdent|' +
                 'table|code,quote|horizontalrule,image,email,link,unlink|' +
-                'emoticon,date,time|maximize,source',
-            colors: '#000000,#808080,#C0C0C0,#FFFFFF|#FF00FF,#800080,#FF0000,#800000|#FFFF00,#808000,#00FF00,#008000|#00FFFF,#008080,#0000FF,#000080'
+                'emoticon,date,time|maximize,source'
         };
 
     function initEditor()