Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BpmnXMLUtil.parseExtensionElement setElementText has bug of Line wrap cover #3886

Open
windNarrowedEyes opened this issue May 10, 2024 · 1 comment

Comments

@windNarrowedEyes
Copy link

Describe the bug
当 extensionElements 元素 text中存在换行时 xtr.next(); 方法会导致数据被覆盖
When there is a line break in the extensionElements element text, xtr. text(); Method can cause data to be overwritten
Expected behavior
A clear and concise description of what you expected to happen.

Code
while (!readyWithExtensionElement && xtr.hasNext()) {
xtr.next();
if (xtr.isCharacters() || XMLStreamReader.CDATA == xtr.getEventType()) {
if (StringUtils.isNotEmpty(xtr.getText().trim())) {
//fix set to append
extensionElement.setElementText(xtr.getText().trim());
}
} else if (xtr.isStartElement()) {
ExtensionElement childExtensionElement = parseExtensionElement(xtr);
extensionElement.addChildElement(childExtensionElement);
} else if (xtr.isEndElement() && extensionElement.getName().equalsIgnoreCase(xtr.getLocalName())) {
readyWithExtensionElement = true;
}
}

@tijsrademakers
Copy link
Contributor

Please provide a unit test showing the issue, then we can look into this further. Without a unit test we have to close the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants