Skip to content
This repository was archived by the owner on Nov 25, 2020. It is now read-only.

Commit 06a7b52

Browse files
committed
Escape quotes and parenthesis before setting backgroundImage style
1 parent 336da04 commit 06a7b52

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

core/src/plugins/gui.ajax/res/js/ui/prototype/class.PreviewFactory.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ Class.create("PreviewFactory", {
8989
if(img == null || oImageToLoad.PFacLoader == null) return;
9090
if(oImageToLoad.editorClass.prototype.getCoveringBackgroundSource && oImageToLoad.mainObject && oImageToLoad.mainObject.hasClassName('background-cover') && Modernizr.backgroundsize){
9191
img.setStyle({display:'none'});
92+
var bgUrl = oImageToLoad.editorClass.prototype.getCoveringBackgroundSource(oImageToLoad.ajxpNode);
93+
bgUrl = bgUrl.replace('(', '\\(').replace(')', '\\)').replace('\'', '\\\'');
9294
oImageToLoad.mainObject.setStyle({
9395
backgroundImage:'url(' + oImageToLoad.editorClass.prototype.getCoveringBackgroundSource(oImageToLoad.ajxpNode) + ')',
9496
backgroundSize : 'cover'

0 commit comments

Comments
 (0)