CKEditorバージョンは、自動的にスタイル属性を削除し、私は要素にスタイル属性を置くかのように「削除」XSS属性を追加するスタイル属性を削除し、「削除」XSSの属性を追加します。CKEditorバージョンは自動的に
<div class="text-center" style="text-align: center;">Test Heading</div>
私が得た保存した後次の出力:
<div class="text-center" xss="removed">Test Heading</div>
私の設定は次のとおりです。
var toolbar_custom=[
{ name: 'document', items: [ 'Source' ] },
{ name: 'editing', items: [ 'Scayt' ] },
{ name: 'basicstyles', items: [ 'Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript', '-', 'RemoveFormat' ] },
{ name: 'paragraph', items: ['JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock'] },
{ name: 'insert', items: [ 'Image', 'Flash', 'Table', 'HorizontalRule', 'Smiley', 'SpecialChar', 'PageBreak', 'Iframe' ] },
{ name: 'links', items: [ 'Link', 'Unlink', 'Anchor' ] },
{ name: 'styles', items: [ 'Styles', 'Format', 'Font', 'FontSize' ]}
];
jQuery(function(){
CKEDITOR.replace('template_editor_custom',{
uiColor:'#2778a7',
toolbar:toolbar_custom,
autoParagraph:false,
enterMode:CKEDITOR.ENTER_DIV,
allowedContent:true,
extraAllowedContent:'*{*}'
})
});
のHTML :
<textarea class="form-control textbox-style" id="template_editor_custom" name="page[content]" placeholder="Page content"><?php echo set_value('page[content]', $content); ?></textarea>
いいえ、私はCIのV3を使用しています。 1.X、私はコア/ Security.phpファイルをオーバーライドすることで問題を解決し、スタイルの制限をリストから削除しました。グローバルxssフィルタリングをfalseに設定すると、サイトのセキュリティ全体が損なわれます。 –