[struts] branch WW-5054-debug-browser created (now 2c02100)

2020-01-12 Thread lukaszlenart
This is an automated email from the ASF dual-hosted git repository.

lukaszlenart pushed a change to branch WW-5054-debug-browser
in repository https://gitbox.apache.org/repos/asf/struts.git.


  at 2c02100  WW-5054 Fixes links in config-browser

This branch includes the following new commits:

 new 8326535  WW-5054 Allows omit class/packages restrictions in devMode
 new a270fd3  WW-5054 Does not escapes debug results
 new 2c02100  WW-5054 Fixes links in config-browser

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.




[struts] 03/03: WW-5054 Fixes links in config-browser

2020-01-12 Thread lukaszlenart
This is an automated email from the ASF dual-hosted git repository.

lukaszlenart pushed a commit to branch WW-5054-debug-browser
in repository https://gitbox.apache.org/repos/asf/struts.git

commit 2c02100c293723dba5183a34fe16c12f81342b3f
Author: Lukasz Lenart 
AuthorDate: Sun Jan 12 12:08:59 2020 +0100

WW-5054 Fixes links in config-browser
---
 .../config-browser/src/main/resources/config-browser/actionNames.ftl  | 2 +-
 .../config-browser/src/main/resources/config-browser/showConfig.ftl   | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git 
a/plugins/config-browser/src/main/resources/config-browser/actionNames.ftl 
b/plugins/config-browser/src/main/resources/config-browser/actionNames.ftl
index 54a5565..226f2a5 100644
--- a/plugins/config-browser/src/main/resources/config-browser/actionNames.ftl
+++ b/plugins/config-browser/src/main/resources/config-browser/actionNames.ftl
@@ -26,7 +26,7 @@


<#list actionNames as name>
-<@s.url var="showConfig" action="showConfig" 
includeParams="none">
+<@s.url var="showConfig" action="showConfig" 
includeParams="none" escapeAmp="false">
 <@s.param name="namespace">${namespace}
 <@s.param name="actionName">${name}
 
diff --git 
a/plugins/config-browser/src/main/resources/config-browser/showConfig.ftl 
b/plugins/config-browser/src/main/resources/config-browser/showConfig.ftl
index 7daff47..1c4354e 100644
--- a/plugins/config-browser/src/main/resources/config-browser/showConfig.ftl
+++ b/plugins/config-browser/src/main/resources/config-browser/showConfig.ftl
@@ -39,11 +39,11 @@
 
 
 
-<@s.url var="url" action="showConfig" includeParams="none">
+<@s.url var="url" action="showConfig" includeParams="none" escapeAmp="false">
 <@s.param name="namespace">${namespace}
 <@s.param name="actionName">${actionName}
 
-<#assign url = url + "&detailView=">
+<#assign url = url + "&detailView=">
 
 <#assign detailsSelected = false>
 <#assign exceptionsSelected = false>



[struts] 01/03: WW-5054 Allows omit class/packages restrictions in devMode

2020-01-12 Thread lukaszlenart
This is an automated email from the ASF dual-hosted git repository.

lukaszlenart pushed a commit to branch WW-5054-debug-browser
in repository https://gitbox.apache.org/repos/asf/struts.git

commit 8326535c3e2637352f8d4b7801059fbf34ee4e46
Author: Lukasz Lenart 
AuthorDate: Sun Jan 12 12:07:56 2020 +0100

WW-5054 Allows omit class/packages restrictions in devMode
---
 .../com/opensymphony/xwork2/ognl/OgnlUtil.java |  39 ++-
 .../debugging/DebuggingInterceptor.java| 128 +++--
 .../interceptor/debugging/ObjectToHTMLWriter.java  |  36 --
 3 files changed, 126 insertions(+), 77 deletions(-)

diff --git a/core/src/main/java/com/opensymphony/xwork2/ognl/OgnlUtil.java 
b/core/src/main/java/com/opensymphony/xwork2/ognl/OgnlUtil.java
index 01d5374..9798974 100644
--- a/core/src/main/java/com/opensymphony/xwork2/ognl/OgnlUtil.java
+++ b/core/src/main/java/com/opensymphony/xwork2/ognl/OgnlUtil.java
@@ -65,6 +65,10 @@ public class OgnlUtil {
 private Set excludedPackageNamePatterns;
 private Set excludedPackageNames;
 
+private Set> excludedClassesCopy;
+private Set excludedPackageNamePatternsCopy;
+private Set excludedPackageNamesCopy;
+
 private Container container;
 private boolean allowStaticFieldAccess = true;
 private boolean allowStaticMethodAccess;
@@ -111,6 +115,33 @@ public class OgnlUtil {
 this.excludedClasses = Collections.unmodifiableSet(excludedClasses);
 }
 
+public void avoidAccessControl() {
+if (devMode) {
+LOG.warn("Cleans up excluded classes and packages in devMode");
+excludedClassesCopy = new HashSet<>(excludedClasses);
+excludedClasses = Collections.unmodifiableSet(new HashSet<>());
+
+excludedPackageNamePatternsCopy = new 
HashSet<>(excludedPackageNamePatterns);
+excludedPackageNamePatterns = Collections.unmodifiableSet(new 
HashSet<>());
+
+excludedPackageNamesCopy = new HashSet<>(excludedPackageNames);
+excludedPackageNames = Collections.unmodifiableSet(new 
HashSet<>());
+}
+}
+public void restoreAccessControl() {
+if (devMode) {
+LOG.warn("Restores excluded classes and packages in devMode");
+excludedClasses = Collections.unmodifiableSet(excludedClassesCopy);
+excludedClassesCopy = null;
+
+excludedPackageNamePatterns = 
Collections.unmodifiableSet(excludedPackageNamePatternsCopy);
+excludedPackageNamePatternsCopy = null;
+
+excludedPackageNames = 
Collections.unmodifiableSet(excludedPackageNamesCopy);
+excludedPackageNamesCopy = null;
+}
+}
+
 private Set> parseExcludedClasses(String commaDelimitedClasses) {
 Set classNames = 
TextParseUtil.commaDelimitedStringToSet(commaDelimitedClasses);
 Set> classes = new HashSet<>();
@@ -339,7 +370,7 @@ public class OgnlUtil {
  *problems setting the properties
  */
 public void setProperties(Map properties, Object o, boolean 
throwPropertyExceptions) {
-Map context = createDefaultContext(o, null);
+Map context = createDefaultContext(o);
 setProperties(properties, o, context, throwPropertyExceptions);
 }
 
@@ -608,8 +639,8 @@ public class OgnlUtil {
 return;
 }
 
-final Map contextFrom = createDefaultContext(from, null);
-final Map contextTo = createDefaultContext(to, null);
+final Map contextFrom = createDefaultContext(from);
+final Map contextTo = createDefaultContext(to);
 
 PropertyDescriptor[] fromPds;
 PropertyDescriptor[] toPds;
@@ -719,7 +750,7 @@ public class OgnlUtil {
  */
 public Map getBeanMap(final Object source) throws 
IntrospectionException, OgnlException {
 Map beanMap = new HashMap<>();
-final Map sourceMap = createDefaultContext(source, null);
+final Map sourceMap = createDefaultContext(source);
 PropertyDescriptor[] propertyDescriptors = 
getPropertyDescriptors(source);
 for (PropertyDescriptor propertyDescriptor : propertyDescriptors) {
 final String propertyName = propertyDescriptor.getDisplayName();
diff --git 
a/core/src/main/java/org/apache/struts2/interceptor/debugging/DebuggingInterceptor.java
 
b/core/src/main/java/org/apache/struts2/interceptor/debugging/DebuggingInterceptor.java
index 7e995f8..ff7e2d3 100644
--- 
a/core/src/main/java/org/apache/struts2/interceptor/debugging/DebuggingInterceptor.java
+++ 
b/core/src/main/java/org/apache/struts2/interceptor/debugging/DebuggingInterceptor.java
@@ -23,6 +23,7 @@ import com.opensymphony.xwork2.ActionInvocation;
 import com.opensymphony.xwork2.inject.Inject;
 import com.opensymphony.xwork2.interceptor.AbstractInterceptor;
 import com.opensymphony.xwork2.interceptor.PreResultListener;
+import com.opensymphony.xwork2.ognl.OgnlUtil;
 import com.opensymphony.xwork2.

[struts] 02/03: WW-5054 Does not escapes debug results

2020-01-12 Thread lukaszlenart
This is an automated email from the ASF dual-hosted git repository.

lukaszlenart pushed a commit to branch WW-5054-debug-browser
in repository https://gitbox.apache.org/repos/asf/struts.git

commit a270fd376fb38504a290ab2c23763f4ffd1299e5
Author: Lukasz Lenart 
AuthorDate: Sun Jan 12 12:08:39 2020 +0100

WW-5054 Does not escapes debug results
---
 .../main/resources/org/apache/struts2/interceptor/debugging/browser.ftl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/core/src/main/resources/org/apache/struts2/interceptor/debugging/browser.ftl 
b/core/src/main/resources/org/apache/struts2/interceptor/debugging/browser.ftl
index 6558608..f1dcbbf 100644
--- 
a/core/src/main/resources/org/apache/struts2/interceptor/debugging/browser.ftl
+++ 
b/core/src/main/resources/org/apache/struts2/interceptor/debugging/browser.ftl
@@ -86,6 +86,6 @@
 
 
 
-${debugHtml}
+${debugHtml?no_esc}