You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@struts.apache.org by lu...@apache.org on 2019/10/01 06:36:52 UTC
[struts] branch master updated: Merge pull request #354 from
JCgH4164838Gh792C124B5/localS2_25x_B10
This is an automated email from the ASF dual-hosted git repository.
lukaszlenart pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/struts.git
The following commit(s) were added to refs/heads/master by this push:
new 40d23ac Merge pull request #354 from JCgH4164838Gh792C124B5/localS2_25x_B10
new ad864ac Merge pull request #368 from JCgH4164838Gh792C124B5/local_26x_CPickPR354
40d23ac is described below
commit 40d23ac315ce1c283319fd2f6f3507fbdddaedba
Author: Lukasz Lenart <lu...@gmail.com>
AuthorDate: Mon Apr 29 07:42:13 2019 +0200
Merge pull request #354 from JCgH4164838Gh792C124B5/localS2_25x_B10
Minor consistency update correction for WW-5029 fix to the 2.5.x branch
(cherry picked from commit bb9ce7582b5b8e021eb458527777db07594e5739)
---
.../config/providers/XmlConfigurationProvider.java | 24 +++++++++++++---------
1 file changed, 14 insertions(+), 10 deletions(-)
diff --git a/core/src/main/java/com/opensymphony/xwork2/config/providers/XmlConfigurationProvider.java b/core/src/main/java/com/opensymphony/xwork2/config/providers/XmlConfigurationProvider.java
index 9cd21fb..1613ae2 100644
--- a/core/src/main/java/com/opensymphony/xwork2/config/providers/XmlConfigurationProvider.java
+++ b/core/src/main/java/com/opensymphony/xwork2/config/providers/XmlConfigurationProvider.java
@@ -93,12 +93,12 @@ public class XmlConfigurationProvider implements ConfigurationProvider {
private String configFileName;
private ObjectFactory objectFactory;
- private Set<String> loadedFileUrls = new HashSet<>();
+ private final Set<String> loadedFileUrls = new HashSet<>();
private boolean errorIfMissing;
private Map<String, String> dtdMappings;
private Configuration configuration;
private boolean throwExceptionOnDuplicateBeans = true;
- private Map<String, Element> declaredPackages = new HashMap<>();
+ private final Map<String, Element> declaredPackages = new HashMap<>();
private FileManager fileManager;
private ValueSubstitutor valueSubstitutor;
@@ -881,10 +881,12 @@ public class XmlConfigurationProvider implements ConfigurationProvider {
final StringBuilder allowedMethodsSB = new StringBuilder();
for (int i = 0; i < allowedMethodsChildren.getLength(); i++) {
Node allowedMethodsChildNode = allowedMethodsChildren.item(i);
- String childNodeValue = (allowedMethodsChildNode != null ? allowedMethodsChildNode.getNodeValue() : "");
- childNodeValue = (childNodeValue != null ? childNodeValue.trim() : "");
- if (childNodeValue.length() > 0) {
- allowedMethodsSB.append(childNodeValue);
+ if (allowedMethodsChildNode != null && allowedMethodsChildNode.getNodeType() == Node.TEXT_NODE) {
+ String childNodeValue = allowedMethodsChildNode.getNodeValue();
+ childNodeValue = (childNodeValue != null ? childNodeValue.trim() : "");
+ if (childNodeValue.length() > 0) {
+ allowedMethodsSB.append(childNodeValue);
+ }
}
}
if (allowedMethodsSB.length() > 0) {
@@ -951,10 +953,12 @@ public class XmlConfigurationProvider implements ConfigurationProvider {
final StringBuilder globalAllowedMethodsSB = new StringBuilder();
for (int i = 0; i < globaAllowedMethodsChildren.getLength(); i++) {
Node globalAllowedMethodsChildNode = globaAllowedMethodsChildren.item(i);
- String childNodeValue = (globalAllowedMethodsChildNode != null ? globalAllowedMethodsChildNode.getNodeValue() : "");
- childNodeValue = (childNodeValue != null ? childNodeValue.trim() : "");
- if (childNodeValue.length() > 0) {
- globalAllowedMethodsSB.append(childNodeValue);
+ if (globalAllowedMethodsChildNode != null && globalAllowedMethodsChildNode.getNodeType() == Node.TEXT_NODE) {
+ String childNodeValue = globalAllowedMethodsChildNode.getNodeValue();
+ childNodeValue = (childNodeValue != null ? childNodeValue.trim() : "");
+ if (childNodeValue.length() > 0) {
+ globalAllowedMethodsSB.append(childNodeValue);
+ }
}
}
if (globalAllowedMethodsSB.length() > 0) {