Skip to content

Commit 4bc36cb

Browse files
author
Hwashiang Yu
committed
MAGETWO-96941: TinyMCE editor JSON attribute improvement
- Added additional JSON check to TinyMCE
1 parent 0965809 commit 4bc36cb

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/web/tiny_mce/plugins/media/editor_plugin_src.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,9 +372,15 @@
372372
};
373373

374374
data = node.attr('data-mce-json');
375-
if (!data)
375+
if (!data || !data.isJSON())
376376
return;
377377

378+
try {
379+
data.evalJSON(true);
380+
} catch {
381+
return;
382+
}
383+
378384
data = JSON.parse(data);
379385
typeItem = this.getType(node.attr('class'));
380386

0 commit comments

Comments
 (0)