Skip to content

Commit 12676ea

Browse files
committed
23.1.4 release
1 parent 1c71e02 commit 12676ea

10 files changed

+1333
-1265
lines changed

ChangeLog

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
13-FEB-2024: 23.1.4
2+
3+
- Fixes CSS scope in SVG sub-trees [drawio-4119]
4+
- Fixes possible XSS for init-editor [CSP-2954]
5+
16
12-FEB-2024: 23.1.3
27

38
- [conf cloud] Added support for Gliffy pinned versions & display name in mass import [DID-10522]

VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
23.1.3
1+
23.1.4

src/main/webapp/js/app.min.js

+497-496
Large diffs are not rendered by default.

src/main/webapp/js/diagramly/EditorUi.js

+76-17
Original file line numberDiff line numberDiff line change
@@ -6007,33 +6007,92 @@
60076007
// Replaces images
60086008
for (var i = 0; i < imgs.length; i++)
60096009
{
6010-
var node = imgs[i];
6011-
var href = null;
6012-
6013-
// Workaround for missing namespace support
6014-
if (node.getAttributeNS == null)
6010+
try
60156011
{
6016-
href = node.getAttribute('xlink:href');
6012+
var node = imgs[i];
6013+
var href = null;
6014+
6015+
// Workaround for missing namespace support
6016+
if (node.getAttributeNS == null)
6017+
{
6018+
href = node.getAttribute('xlink:href');
6019+
}
6020+
else
6021+
{
6022+
href = node.getAttributeNS(mxConstants.NS_XLINK, 'href');
6023+
}
6024+
6025+
var svg = this.getSvgSubtree(href);
6026+
6027+
if (svg != null)
6028+
{
6029+
svg.setAttribute('x', node.getAttribute('x'));
6030+
svg.setAttribute('y', node.getAttribute('y'));
6031+
svg.setAttribute('width', node.getAttribute('width'));
6032+
svg.setAttribute('height', node.getAttribute('height'));
6033+
6034+
node.parentNode.replaceChild(svg, node);
6035+
}
60176036
}
6018-
else
6037+
catch (e)
60196038
{
6020-
href = node.getAttributeNS(mxConstants.NS_XLINK, 'href');
6039+
// ignore
60216040
}
6041+
}
6042+
};
6043+
6044+
/**
6045+
* Returns SVG with modified CSS rules that limit scope to subtree.
6046+
*/
6047+
EditorUi.prototype.getSvgSubtree = function(href)
6048+
{
6049+
var data = Graph.getSvgFromDataUri(href);
6050+
var svg = null;
60226051

6023-
var data = Graph.getSvgFromDataUri(href);
6052+
if (data != null)
6053+
{
6054+
svg = mxUtils.parseXml(data).documentElement;
6055+
var styles = svg.getElementsByTagName('style');
60246056

6025-
if (data != null)
6057+
if (styles.length > 0)
60266058
{
6027-
var svg = mxUtils.parseXml(data).documentElement;
6028-
6029-
svg.setAttribute('x', node.getAttribute('x'));
6030-
svg.setAttribute('y', node.getAttribute('y'));
6031-
svg.setAttribute('width', node.getAttribute('width'));
6032-
svg.setAttribute('height', node.getAttribute('height'));
6059+
var id = 'svg-image-' + Editor.guid();
6060+
svg.setAttribute('id', id);
6061+
6062+
// Adds ID selector for all CSS rules to limit scope
6063+
var doc = document.implementation.createHTMLDocument(''),
6064+
styleElement = document.createElement('style');
6065+
6066+
for (var j = 0; j < styles.length; j++)
6067+
{
6068+
styleElement.textContent = styles[j].textContent;
6069+
doc.body.appendChild(styleElement);
6070+
var modifiedCss = '';
6071+
6072+
for (var k = 0; k < styleElement.sheet.cssRules.length; k++)
6073+
{
6074+
var rule = styleElement.sheet.cssRules[k];
60336075

6034-
node.parentNode.replaceChild(svg, node);
6076+
if (rule.selectorText != null)
6077+
{
6078+
var tokens = rule.selectorText.split(',');
6079+
6080+
for (var l = 0; l < tokens.length; l++)
6081+
{
6082+
tokens[l] = '#' + id + ' ' + tokens[l];
6083+
}
6084+
6085+
rule.selectorText = tokens.join(',');
6086+
modifiedCss += rule.cssText + '\n';
6087+
}
6088+
}
6089+
6090+
styles[j].textContent = modifiedCss;
6091+
}
60356092
}
60366093
}
6094+
6095+
return svg;
60376096
};
60386097

60396098
/**

src/main/webapp/js/integrate.min.js

+651-650
Large diffs are not rendered by default.

src/main/webapp/js/viewer-static.min.js

+50-49
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main/webapp/js/viewer.min.js

+50-49
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main/webapp/mxgraph/mxClient.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main/webapp/service-worker.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main/webapp/service-worker.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)