File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -93,7 +93,7 @@ export const renderEditor = () => {
9393 useSplitMode : false ,
9494 askBeforePasteFromWord : true ,
9595 processPasteFromWord : true ,
96- defaultActionOnPasteFromWord : 'insert_clear_html' ,
96+ defaultActionOnPasteFromWord : Jodit . constants . INSERT_AS_TEXT ,
9797 colors : {
9898 greyscale : [
9999 '#000000' ,
@@ -244,7 +244,7 @@ export const renderEditor = () => {
244244 events : { } ,
245245 textIcons : false ,
246246 uploader : {
247- url : '/admin /api/content/images?csrf=' + ( document . getElementById ( 'pmf-csrf-token' ) as HTMLInputElement ) . value ,
247+ url : '. /api/content/images?csrf=' + ( document . getElementById ( 'pmf-csrf-token' ) as HTMLInputElement ) . value ,
248248 format : 'json' ,
249249 isSuccess : ( response : UploaderResponse ) => {
250250 return ! response . error && response . success === true ;
@@ -264,7 +264,7 @@ export const renderEditor = () => {
264264 } ,
265265 filebrowser : {
266266 ajax : {
267- url : '/admin /api/media-browser' ,
267+ url : '. /api/media-browser' ,
268268 contentType : 'application/json; charset=UTF-8' ,
269269 } ,
270270 createNewFolder : false ,
Original file line number Diff line number Diff line change @@ -135,7 +135,14 @@ public function cleanUpContent(string $content): string
135135 ->allowMediaHosts ($ allowedHosts )
136136 ->allowLinkSchemes (['https ' , 'http ' , 'mailto ' , 'data ' ]));
137137
138- $ sanitizedContent = $ htmlSanitizer ->sanitize ($ content );
138+ // Suppress HTML parser warnings during sanitization, as Dom\HTMLDocument::createFromString()
139+ // emits tokenizer warnings for slightly malformed user-generated HTML content
140+ $ previousErrorReporting = error_reporting (E_ALL & ~E_WARNING );
141+ try {
142+ $ sanitizedContent = $ htmlSanitizer ->sanitize ($ content );
143+ } finally {
144+ error_reporting ($ previousErrorReporting );
145+ }
139146
140147 $ sanitizedContent = preg_replace (
141148 '/<iframe\b(?:(?!src)[^>])*>\s*<\/iframe>/i ' ,
You can’t perform that action at this time.
0 commit comments