-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8707 from ckeditor/i/7957
Fix (image): Allow pasting an image with data URL scheme in src, if strict CSP rules are defined. Closes #7957.
- Loading branch information
Showing
5 changed files
with
245 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
packages/ckeditor5-paste-from-office/tests/manual/tickets/7957/1.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<head> | ||
<meta http-equiv="Content-Security-Policy" content=" | ||
default-src 'none'; | ||
connect-src 'self' http://*.cke-cs.com; | ||
script-src 'self' 'unsafe-eval'; | ||
img-src * data: blob:; | ||
style-src 'self' 'unsafe-inline'; | ||
frame-src *" | ||
> | ||
</head> | ||
|
||
<div id="editor"> | ||
<h2>Paste here:</h2> | ||
</div> |
42 changes: 42 additions & 0 deletions
42
packages/ckeditor5-paste-from-office/tests/manual/tickets/7957/1.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/** | ||
* @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. | ||
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license | ||
*/ | ||
|
||
/* globals console, window, document */ | ||
|
||
import ClassicEditor from '@ckeditor/ckeditor5-editor-classic/src/classiceditor'; | ||
import ArticlePluginSet from '@ckeditor/ckeditor5-core/tests/_utils/articlepluginset'; | ||
|
||
import Strikethrough from '@ckeditor/ckeditor5-basic-styles/src/strikethrough'; | ||
import Underline from '@ckeditor/ckeditor5-basic-styles/src/underline'; | ||
import Table from '@ckeditor/ckeditor5-table/src/table'; | ||
import TableToolbar from '@ckeditor/ckeditor5-table/src/tabletoolbar'; | ||
import EasyImage from '@ckeditor/ckeditor5-easy-image/src/easyimage'; | ||
import FontColor from '@ckeditor/ckeditor5-font/src/fontcolor'; | ||
import FontBackgroundColor from '@ckeditor/ckeditor5-font/src/fontbackgroundcolor'; | ||
import PageBreak from '@ckeditor/ckeditor5-page-break/src/pagebreak'; | ||
import TableProperties from '@ckeditor/ckeditor5-table/src/tableproperties'; | ||
import TableCellProperties from '@ckeditor/ckeditor5-table/src/tablecellproperties'; | ||
|
||
import PasteFromOffice from '../../../../src/pastefromoffice'; | ||
|
||
import { CS_CONFIG } from '@ckeditor/ckeditor5-cloud-services/tests/_utils/cloud-services-config'; | ||
|
||
ClassicEditor | ||
.create( document.querySelector( '#editor' ), { | ||
plugins: [ ArticlePluginSet, Strikethrough, Underline, Table, TableToolbar, PageBreak, | ||
TableProperties, TableCellProperties, EasyImage, PasteFromOffice, FontColor, FontBackgroundColor ], | ||
toolbar: [ 'heading', '|', 'bold', 'italic', 'strikethrough', 'underline', 'link', | ||
'bulletedList', 'numberedList', 'blockQuote', 'insertTable', 'pageBreak', 'undo', 'redo' ], | ||
table: { | ||
contentToolbar: [ 'tableColumn', 'tableRow', 'mergeTableCells', 'tableProperties', 'tableCellProperties' ] | ||
}, | ||
cloudServices: CS_CONFIG | ||
} ) | ||
.then( editor => { | ||
window.editor = editor; | ||
} ) | ||
.catch( err => { | ||
console.error( err.stack ); | ||
} ); |
7 changes: 7 additions & 0 deletions
7
packages/ckeditor5-paste-from-office/tests/manual/tickets/7957/1.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
## Paste from Office | ||
|
||
Test for Paste from Word, when strict CSP rules are configured. | ||
|
||
Check: | ||
|
||
1. Copy & paste some content from Word including at least one image. |